bip-0.9.3/0000775000175000017500000000000014212410721007272 500000000000000bip-0.9.3/install-sh0000754000175000017500000003577614212410717011242 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bip-0.9.3/Makefile.am0000664000175000017500000000062214212375343011260 00000000000000if COND_WANT_TESTS MAYBE_TESTS = tests endif SUBDIRS = src . $(MAYBE_TESTS) dist_man_MANS = bip.1 bip.conf.5 bipmkpw.1 examplesdir = $(prefix)/share/doc/bip/examples/ dist_examples_DATA = samples/bip.conf samples/bip.vim EXTRA_DIST = \ BUGS \ scripts/bip-release \ scripts/bipgenconfig \ systemd lint: find src/ tests/ \( -name *.c -o -name *.h \) -type f -print0 | xargs -0 clang-format -i bip-0.9.3/COPYING0000664000175000017500000004367212442320231010260 00000000000000bip copyright 2004 2005 Arnaud Cornet and Loïc Gomez, is released under the terms of the GNU GPL, License that you can find below. Specific permission is granted for the GPLed code in this distribution to be linked to OpenSSL without invoking GPL clause 2(b). -------------------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, 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 Library 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 St, 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 Library General Public License instead of this License. bip-0.9.3/Makefile.in0000664000175000017500000007437414212410717011303 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ 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 = : 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) $(dist_examples_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/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; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(examplesdir)" man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_examples_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) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = src . tests am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README TODO ar-lib compile \ 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 # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ 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@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_AR = @ac_ct_AR@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @COND_WANT_TESTS_TRUE@MAYBE_TESTS = tests SUBDIRS = src . $(MAYBE_TESTS) dist_man_MANS = bip.1 bip.conf.5 bipmkpw.1 examplesdir = $(prefix)/share/doc/bip/examples/ dist_examples_DATA = samples/bip.conf samples/bip.vim EXTRA_DIST = \ BUGS \ scripts/bip-release \ scripts/bipgenconfig \ systemd all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_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='$(dist_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-dist_examplesDATA: $(dist_examples_DATA) @$(NORMAL_INSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || 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)$(examplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesdir)" || exit $$?; \ done uninstall-dist_examplesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(examplesdir)'; $(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-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(examplesdir)"; 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-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_examplesDATA install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-man5 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-dist_examplesDATA uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .MAKE: $(am__recursive_targets) 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 \ dist-zstd distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_examplesDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man5 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_examplesDATA uninstall-man uninstall-man1 \ uninstall-man5 .PRECIOUS: Makefile lint: find src/ tests/ \( -name *.c -o -name *.h \) -type f -print0 | xargs -0 clang-format -i # 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: bip-0.9.3/configure0000744000175000017500000060037314212410717011133 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for Bip IRC Proxy 0.9.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 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 as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop 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 \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: http://bip.milkypond.org/projects/bip/activity about $0: your system, including any error possibly output before $0: this message. Then install a modern shell, or manually $0: run the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop 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_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_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='Bip IRC Proxy' PACKAGE_TARNAME='bip' PACKAGE_VERSION='0.9.3' PACKAGE_STRING='Bip IRC Proxy 0.9.3' PACKAGE_BUGREPORT='http://bip.milkypond.org/projects/bip/activity' PACKAGE_URL='http://bip.milkypond.org/' ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS COND_WANT_TESTS_FALSE COND_WANT_TESTS_TRUE CHECK_LIBS CHECK_CFLAGS OPENSSL_LIBS OPENSSL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX RANLIB ac_ct_AR AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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_maintainer_mode enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR OPENSSL_CFLAGS OPENSSL_LIBS CHECK_CFLAGS CHECK_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Bip IRC Proxy 0.9.3 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/bip] --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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Bip IRC Proxy 0.9.3:";; 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-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build 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 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. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path OPENSSL_CFLAGS C compiler flags for OPENSSL, overriding pkg-config OPENSSL_LIBS linker flags for OPENSSL, overriding pkg-config CHECK_CFLAGS C compiler flags for CHECK, overriding pkg-config CHECK_LIBS linker flags for CHECK, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . Bip IRC Proxy home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Bip IRC Proxy configure 0.9.3 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$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_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$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 run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status 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_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop 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. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Bip IRC Proxy $as_me 0.9.3, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (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 do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # Auxiliary files required by this configure script. ac_aux_files="ar-lib compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$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. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='bip' VERSION='0.9.3' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else $as_nop USE_MAINTAINER_MODE=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers src/config.h" # Checks for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 printf %s "checking the archiver ($AR) interface... " >&6; } if test ${am_cv_ar_interface+y} then : printf %s "(cached) " >&6 else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO" then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LEX+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 printf "%s\n" "$LEX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %{ #ifdef __cplusplus extern "C" #endif int yywrap(void); %} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ #ifdef __cplusplus yyless ((yyinput () != 0)); #else yyless ((input () != 0)); #endif } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int yywrap (void) { return 1; } int main (void) { return ! yylex (); } _ACEOF { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 printf %s "checking for lex output file root... " >&6; } if test ${ac_cv_prog_lex_root+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_lex_root=unknown { { 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 printf "%s\n" "$ac_cv_prog_lex_root" >&6; } if test "$ac_cv_prog_lex_root" = unknown then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} LEX=: LEXLIB= fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test ${LEXLIB+y} then : else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 printf %s "checking for lex library... " >&6; } if test ${ac_cv_lib_lex+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_LIBS="$LIBS" ac_found=false for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do case $ac_cv_lib_lex in #( 'none needed') : ;; #( 'not found') : break ;; #( *) : LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( *) : ;; esac 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_found=: fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if $ac_found; then break fi done LIBS="$ac_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 printf "%s\n" "$ac_cv_lib_lex" >&6; } if test "$ac_cv_lib_lex" = 'not found' then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} LEX=: LEXLIB= elif test "$ac_cv_lib_lex" = 'none needed' then : LEXLIB='' else $as_nop LEXLIB=$ac_cv_lib_lex fi ac_save_LIBS="$LIBS" LIBS= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing yywrap" >&5 printf %s "checking for library containing yywrap... " >&6; } if test ${ac_cv_search_yywrap+y} then : printf %s "(cached) " >&6 else $as_nop 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. */ char yywrap (); int main (void) { return yywrap (); ; return 0; } _ACEOF for ac_lib in '' fl l 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_yywrap=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_yywrap+y} then : break fi done if test ${ac_cv_search_yywrap+y} then : else $as_nop ac_cv_search_yywrap=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yywrap" >&5 printf "%s\n" "$ac_cv_search_yywrap" >&6; } ac_res=$ac_cv_search_yywrap if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" LEXLIB="$LIBS" fi LIBS="$ac_save_LIBS" fi if test "$LEX" != : then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 printf %s "checking whether yytext is a pointer... " >&6; } if test ${ac_cv_prog_lex_yytext_pointer+y} then : printf %s "(cached) " >&6 else $as_nop # 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 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_compile "$LINENO" then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 printf "%s\n" "$YACC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssl >= 0.9.8 libcrypto >= 0.9.8" >&5 printf %s "checking for libssl >= 0.9.8 libcrypto >= 0.9.8... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssl >= 0.9.8 libcrypto >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libssl >= 0.9.8 libcrypto >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "libssl >= 0.9.8 libcrypto >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$OPENSSL_LIBS"; then pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssl >= 0.9.8 libcrypto >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libssl >= 0.9.8 libcrypto >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "libssl >= 0.9.8 libcrypto >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libssl >= 0.9.8 libcrypto >= 0.9.8" 2>&1` else OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libssl >= 0.9.8 libcrypto >= 0.9.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$OPENSSL_PKG_ERRORS" >&5 with_openssl=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } with_openssl=no else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } with_openssl=yes printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts PIE flags" >&5 printf %s "checking whether $CC accepts PIE flags... " >&6; } if test ${ap_cv_cc_pie+y} then : printf %s "(cached) " >&6 else $as_nop save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" if test "$cross_compiling" = yes then : ap_cv_cc_pie=yes else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ static int foo[30000]; int main () { return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ap_cv_cc_pie=yes else $as_nop ap_cv_cc_pie=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ap_cv_cc_pie" >&5 printf "%s\n" "$ap_cv_cc_pie" >&6; } if test "$ap_cv_cc_pie" = "yes"; then CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" enable_pie=yes fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for check >= 0.9.6" >&5 printf %s "checking for check >= 0.9.6... " >&6; } if test -n "$CHECK_CFLAGS"; then pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.9.6") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.9.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CHECK_LIBS"; then pkg_cv_CHECK_LIBS="$CHECK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.9.6") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.9.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.9.6" 2>&1` else CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.9.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CHECK_PKG_ERRORS" >&5 enable_tests=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } enable_tests=no else CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS CHECK_LIBS=$pkg_cv_CHECK_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } enable_tests=yes fi if test "$enable_tests" = yes; then COND_WANT_TESTS_TRUE= COND_WANT_TESTS_FALSE='#' else COND_WANT_TESTS_TRUE='#' COND_WANT_TESTS_FALSE= fi ac_fn_c_check_func "$LINENO" "backtrace_symbols_fd" "ac_cv_func_backtrace_symbols_fd" if test "x$ac_cv_func_backtrace_symbols_fd" = xyes then : printf "%s\n" "#define HAVE_BACKTRACE /**/" >>confdefs.h LDFLAGS="-rdynamic $LDFLAGS" backtrace="(with backtrace)" fi ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_WANT_TESTS_TRUE}" && test -z "${COND_WANT_TESTS_FALSE}"; then as_fn_error $? "conditional \"COND_WANT_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop 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_nop 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 || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_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 Bip IRC Proxy $as_me 0.9.3, which was generated by GNU Autoconf 2.71. 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 . Bip IRC Proxy home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ Bip IRC Proxy config.status 0.9.3 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _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 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo OPENSSL: $with_openssl echo PIE: $enable_pie echo TESTS: $enable_tests bip-0.9.3/configure.ac0000664000175000017500000000711214212410715011504 00000000000000m4_pattern_allow([^AM_]) m4_pattern_allow([^AC_]) AC_PREREQ([2.69]) AC_INIT([Bip IRC Proxy],[0.9.3],[http://bip.milkypond.org/projects/bip/activity],[bip],[http://bip.milkypond.org/]) AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror]) AM_MAINTAINER_MODE AC_CONFIG_HEADERS([src/config.h]) # Checks for programs AC_PROG_CC AM_PROG_AR AC_PROG_RANLIB AC_PROG_INSTALL AM_PROG_LEX AC_PROG_YACC dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES(OPENSSL, [libssl >= 0.9.8 libcrypto >= 0.9.8], [ with_openssl=yes AC_DEFINE([HAVE_LIBSSL], [1], [Build SSL support]) ], [ with_openssl=no ]) AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [ save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" AC_RUN_IFELSE([AC_LANG_SOURCE([[static int foo[30000]; int main () { return 0; }]])], [ap_cv_cc_pie=yes], [ap_cv_cc_pie=no], [ap_cv_cc_pie=yes] ) CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS ]) if test "$ap_cv_cc_pie" = "yes"; then CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" enable_pie=yes fi PKG_CHECK_MODULES([CHECK], [check >= 0.9.6], [enable_tests=yes], [enable_tests=no]) AM_CONDITIONAL([COND_WANT_TESTS], [test "$enable_tests" = yes]) AC_CHECK_FUNC(backtrace_symbols_fd, [ AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()]) LDFLAGS="-rdynamic $LDFLAGS" backtrace="(with backtrace)" ]) AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile]) AC_OUTPUT echo OPENSSL: $with_openssl echo PIE: $enable_pie echo TESTS: $enable_tests bip-0.9.3/ylwrap0000754000175000017500000001531414212410717010464 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bip-0.9.3/test-driver0000754000175000017500000001141714212410717011416 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook '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: bip-0.9.3/missing0000754000175000017500000001533614212410717010623 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 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: bip-0.9.3/aclocal.m40000664000175000017500000015671114212410716011071 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR bip-0.9.3/tests/0000775000175000017500000000000014212410721010434 500000000000000bip-0.9.3/tests/Makefile.am0000664000175000017500000000042014212375472012421 00000000000000TESTS = check_line check_PROGRAMS = check_line check_line_SOURCES = check_line.c $(top_builddir)/src/line.h check_line_CFLAGS = @CHECK_CFLAGS@ $(OPENSSL_CFLAGS) check_line_LDADD = $(top_builddir)/src/libbip.a $(top_builddir)/src/libbiplex.a @CHECK_LIBS@ $(OPENSSL_LIBS) bip-0.9.3/tests/Makefile.in0000664000175000017500000007767414212410717012453 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ 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 = : TESTS = check_line$(EXEEXT) check_PROGRAMS = check_line$(EXEEXT) subdir = tests 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)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_check_line_OBJECTS = check_line-check_line.$(OBJEXT) check_line_OBJECTS = $(am_check_line_OBJECTS) am__DEPENDENCIES_1 = check_line_DEPENDENCIES = $(top_builddir)/src/libbip.a \ $(top_builddir)/src/libbiplex.a $(am__DEPENDENCIES_1) check_line_LINK = $(CCLD) $(check_line_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/check_line-check_line.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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 = $(check_line_SOURCES) DIST_SOURCES = $(check_line_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ 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@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_AR = @ac_ct_AR@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ check_line_SOURCES = check_line.c $(top_builddir)/src/line.h check_line_CFLAGS = @CHECK_CFLAGS@ $(OPENSSL_CFLAGS) check_line_LDADD = $(top_builddir)/src/libbip.a $(top_builddir)/src/libbiplex.a @CHECK_LIBS@ $(OPENSSL_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) check_line$(EXEEXT): $(check_line_OBJECTS) $(check_line_DEPENDENCIES) $(EXTRA_check_line_DEPENDENCIES) @rm -f check_line$(EXEEXT) $(AM_V_CCLD)$(check_line_LINK) $(check_line_OBJECTS) $(check_line_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_line-check_line.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` check_line-check_line.o: check_line.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_line_CFLAGS) $(CFLAGS) -MT check_line-check_line.o -MD -MP -MF $(DEPDIR)/check_line-check_line.Tpo -c -o check_line-check_line.o `test -f 'check_line.c' || echo '$(srcdir)/'`check_line.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_line-check_line.Tpo $(DEPDIR)/check_line-check_line.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_line.c' object='check_line-check_line.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_line_CFLAGS) $(CFLAGS) -c -o check_line-check_line.o `test -f 'check_line.c' || echo '$(srcdir)/'`check_line.c check_line-check_line.obj: check_line.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_line_CFLAGS) $(CFLAGS) -MT check_line-check_line.obj -MD -MP -MF $(DEPDIR)/check_line-check_line.Tpo -c -o check_line-check_line.obj `if test -f 'check_line.c'; then $(CYGPATH_W) 'check_line.c'; else $(CYGPATH_W) '$(srcdir)/check_line.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_line-check_line.Tpo $(DEPDIR)/check_line-check_line.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_line.c' object='check_line-check_line.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_line_CFLAGS) $(CFLAGS) -c -o check_line-check_line.obj `if test -f 'check_line.c'; then $(CYGPATH_W) 'check_line.c'; else $(CYGPATH_W) '$(srcdir)/check_line.c'; fi` 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? check_line.log: check_line$(EXEEXT) @p='check_line$(EXEEXT)'; \ b='check_line'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) 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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) 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-checkPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/check_line-check_line.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)/check_line-check_line.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: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic 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 \ recheck 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: bip-0.9.3/tests/check_line.c0000664000175000017500000000722313403705550012620 00000000000000#include #include "../src/line.h" START_TEST(test_line_init) { struct line line; irc_line_init(&line); irc_line_append(&line, "line"); char *hi_string = irc_line_to_string(&line); ck_assert_str_eq(hi_string, "line\r\n"); free(hi_string); _irc_line_deinit(&line); struct line *line2 = irc_line_new(); irc_line_append(line2, "line"); hi_string = irc_line_to_string(line2); ck_assert_str_eq(hi_string, "line\r\n"); free(hi_string); irc_line_free(line2); } END_TEST START_TEST(test_line_parse) { struct line *line = irc_line_new_from_string( ":origin COMMAND parameter1 parameter2 " ":multi word parameter\r\n"); ck_assert_int_eq(irc_line_count(line), 4); ck_assert(irc_line_includes(line, 0)); ck_assert(irc_line_includes(line, 3)); ck_assert(!irc_line_includes(line, 4)); ck_assert_str_eq(line->origin, "origin"); ck_assert_str_eq(irc_line_elem(line, 0), "COMMAND"); ck_assert_str_eq(irc_line_elem(line, 1), "parameter1"); ck_assert_str_eq(irc_line_elem(line, 2), "parameter2"); ck_assert_str_eq(irc_line_elem(line, 3), "multi word parameter\r\n"); irc_line_free(line); line = irc_line_new_from_string( "COMMAND parameter1 parameter2 :multi word parameter\r\n"); ck_assert_int_eq(irc_line_count(line), 4); ck_assert(irc_line_includes(line, 0)); ck_assert(irc_line_includes(line, 3)); ck_assert(!irc_line_includes(line, 4)); ck_assert_str_eq(irc_line_elem(line, 0), "COMMAND"); ck_assert_str_eq(irc_line_elem(line, 1), "parameter1"); ck_assert_str_eq(irc_line_elem(line, 2), "parameter2"); ck_assert_str_eq(irc_line_elem(line, 3), "multi word parameter\r\n"); irc_line_free(line); line = irc_line_new_from_string(":origin COMMAND\r\n"); ck_assert_str_eq(line->origin, "origin"); ck_assert_int_eq(irc_line_count(line), 1); ck_assert(irc_line_includes(line, 0)); ck_assert(!irc_line_includes(line, 1)); ck_assert_str_eq(irc_line_elem(line, 0), "COMMAND\r\n"); irc_line_free(line); } END_TEST START_TEST(test_elem_equals) { struct line *line = irc_line_new_from_string( ":origin COMMAND parameter1 parameter2 " ":multi word parameter\r\n"); ck_assert(irc_line_elem_equals(line, 0, "COMMAND")); ck_assert(irc_line_elem_case_equals(line, 0, "command")); ck_assert(!irc_line_elem_equals(line, 0, "notcommand")); ck_assert(!irc_line_elem_case_equals(line, 0, "notcommand")); irc_line_free(line); } END_TEST START_TEST(test_line_pop) { struct line *line = irc_line_new_from_string( ":origin COMMAND parameter1 parameter2 " ":multi word parameter\r\n"); char *top = irc_line_pop(line); ck_assert_str_eq(top, "multi word parameter\r\n"); free(top); top = irc_line_pop(line); ck_assert_str_eq(top, "parameter2"); free(top); irc_line_free(line); } END_TEST START_TEST(test_line_drop) { struct line *line = irc_line_new_from_string( ":origin COMMAND parameter1 parameter2 " ":multi word parameter\r\n"); irc_line_drop(line, 1); ck_assert(irc_line_elem_equals(line, 0, "COMMAND")); ck_assert(irc_line_elem_equals(line, 1, "parameter2")); irc_line_drop(line, 0); ck_assert(irc_line_elem_equals(line, 0, "parameter2")); irc_line_free(line); } END_TEST Suite *money_suite(void) { Suite *s; TCase *tc_core; s = suite_create("bip"); tc_core = tcase_create("core"); tcase_add_test(tc_core, test_line_init); tcase_add_test(tc_core, test_line_parse); tcase_add_test(tc_core, test_elem_equals); tcase_add_test(tc_core, test_line_pop); suite_add_tcase(s, tc_core); return s; } int main(void) { int number_failed; Suite *s; SRunner *sr; s = money_suite(); sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); number_failed = srunner_ntests_failed(sr); srunner_free(sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } bip-0.9.3/ar-lib0000754000175000017500000001336314212410717010316 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2019-07-04.01; # UTC # Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # 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: bip-0.9.3/ChangeLog0000664000175000017500000041722414212410715011001 00000000000000commit 18665b150198d283419d2e1d72901af96eda18e4 (G) Author: Pierre-Louis Bonicoli Date: Thu Mar 10 14:38:26 2022 +0100 Update NEWS file (SASL, GCC flags, /bip user info) commit f2fd1824caad008ad529a2860d8568208a0955e7 (G) Author: Pierre-Louis Bonicoli Date: Thu Mar 10 13:52:03 2022 +0100 Format the whole code using clang-format commit 8d9658ca43242d4c8bc203846017a907ebb39fcc (G) Author: Loïc Gomez Date: Thu Mar 10 13:09:41 2022 +0100 Build lexer in a separate unit without AM_CFLAGS commit e04f97c78ff528b3c83c080fcb3ecade664b5c73 (G) Author: Loïc Gomez Date: Mon Jan 10 19:30:56 2022 +0100 ignore some issues related to array_get ignore "passing argument X of .... with different width due to prototype" commit 26d347dec6d7f096cc41a9dac67984a3e1987105 (G) Author: Loïc Gomez Date: Mon Jan 10 18:10:50 2022 +0100 sanitize: fix const char * being used as non-const commit ee6ee0bd34855baf755c57047bb1404ebd930c17 (G) Author: Loïc Gomez Date: Sun Jan 9 22:15:46 2022 +0100 irc_cli_part set cname to proper const char * commit edf78eadb1f1e69172451189aae50827dc179ea1 (G) Author: Loïc Gomez Date: Sun Jan 9 21:30:25 2022 +0100 sanitize: pragmas for our code commit efb79b1e806142865f63255274f88f43af0c3362 (G) Author: Loïc Gomez Date: Sun Jan 9 21:24:25 2022 +0100 sanitize: a bit evolved size_t cast for get_str_elem commit 79d9be4e71b171cf047bed0f59377dd9ce930d1e (G) Author: Loïc Gomez Date: Sun Jan 9 20:43:26 2022 +0100 sanitize: ftell/fseek & len/file_offset type fixes commit dbf8ccd4de68f3dc54efaf63e782c19570ef77bb (G) Author: Loïc Gomez Date: Sun Jan 9 20:39:38 2022 +0100 sanitize: more NULL pointer failsafes commit f54775fe9204942ab174c8d8e9a88a183c42fed3 (G) Author: Loïc Gomez Date: Sun Jan 9 20:37:55 2022 +0100 sanitize: ignore warnings related to external libs commit f379eb35d29c86d0667be072e02e5dfe4af2ec23 (G) Author: Loïc Gomez Date: Sun Jan 9 20:35:50 2022 +0100 sanitize: oidentd handler fixes commit ce4cf8b6a0c8610cc4df096184c006e7cfdd044b (G) Author: Loïc Gomez Date: Sun Jan 9 21:02:48 2022 +0100 sanitize: add bip_clock_gettime util function commit 368149575d2cf8aefc6b50983dddb6e1a25b6426 (G) Author: Loïc Gomez Date: Sun Jan 9 20:24:40 2022 +0100 sanitize: null writes, write errors, oversized int, and set incoming_end to size_t commit b990a071b364696432de23a7b6f84807156129fd (G) Author: Loïc Gomez Date: Sun Jan 9 20:11:01 2022 +0100 sanitize: fix pid/pidfile handling commit af590f83b7f8e843b2274c33099b653c2be438da (G) Author: Loïc Gomez Date: Sun Jan 9 21:12:24 2022 +0100 lag shouldn't be allowed to go negative commit 62fd77dc177710574c66e38882c841c1368dec89 (G) Author: Loïc Gomez Date: Sun Jan 9 21:00:33 2022 +0100 l_clientc should not be allowed to go negative commit dd5343b7107ef91a81cae1c74164e08c4421c83f (G) Author: Loïc Gomez Date: Sun Jan 9 20:59:59 2022 +0100 use proper types, safe casts (mostly size_t) commit 94fe272018cfc38b05e98b5b64d9cc959b39e7f1 (G) Author: Loïc Gomez Date: Sun Jan 9 19:34:49 2022 +0100 handle more config errors, use char not int:1 commit fbfae37d6581b6a077021ba5f62bd2af67b16bbf (G) Author: Loïc Gomez Date: Sun Jan 9 19:23:41 2022 +0100 sanitize: configuration parsing commit 9d6394679f075992b9902a7a3b4c2fe61819cb43 (G) Author: Loïc Gomez Date: Sun Jan 9 18:25:44 2022 +0100 sanitize: check return value commit 2a5e7b6f7bea243117d671ec4812f63b46a23a39 (G) Author: Loïc Gomez Date: Sun Jan 9 21:20:49 2022 +0100 sanitize: add trivial casts to types and add missing default cases commit e694dae31cedcfd7dd2eadffb6c9a18b1f4b866c (G) Author: Loïc Gomez Date: Sun Jan 9 18:25:26 2022 +0100 functions without parameters: add missing void commit 26d34bafabe7ba8aa778ff8e7af960d1a6dab081 (G) Author: Loïc Gomez Date: Thu Jan 6 19:48:59 2022 +0100 sanitize: add bipmkpw_fatal & fix bipmkpw warnings commit fe108e390f6400ccc94ebfe09e0215ad57dbdccf (G) Author: Loïc Gomez Date: Thu Jan 6 21:34:55 2022 +0100 Add secure / strict CFLAGS Ref: https://airbus-seclab.github.io/c-compiler-security/#gcc-tldr commit e7d82acfff5877bcede66b6c1661a4a3e9ed3a2e (G) Author: Loïc Gomez Date: Sun Jan 2 15:26:51 2022 +0100 Update build configuration commit 51a46a1454092dc74f64e299770195a2911fbdd3 (G) Author: Loïc Gomez Date: Thu Jan 6 19:57:08 2022 +0100 Add compiled stuff to gitignore commit 7680af6a0998a8fb1b5fb4f93ee8ae3784d01fd6 (G) Author: Loïc Gomez Date: Wed Jan 12 21:48:43 2022 +0100 Add make lint calling clang-format & force 80 cols commit 34b3c4b0c3464211ef129ea9f806595833d0b645 (G) Author: Loïc Gomez Date: Thu Jan 6 13:43:18 2022 +0100 Move /BIP to bip_strcat{,f}_fit memccpy wrapper instead of snprintf. commit 399a104d1ea483623ca15f39a45a699c5ececcb1 (G) Author: Loïc Gomez Date: Thu Jan 6 19:51:11 2022 +0100 fix /bip user info command commit dc43d75d1f7e7c01d943f085120f704d2dac831d (G) Author: Loïc Gomez Date: Sun Jan 2 14:16:10 2022 +0100 Add SASL authentication support (EXTERNAL, PLAIN) commit 1df884545fc4bb901dcea6d4cc1e9eda117f9220 (G) Author: Pierre-Louis Bonicoli Date: Sun Oct 17 12:52:00 2021 +0200 Add a man page for the bipgenconfig script This man page comes from the Debian package. commit 814ef729380adb60e7d60fa7fc02f9fac316023c (G) Author: Pierre-Louis Bonicoli Date: Sun Oct 17 12:47:12 2021 +0200 Add man pages in Documentation key of systemd unit commit 462c1036fc3daefe7ee81262134bd6542e4cc8be (G) Author: Pierre-Louis Bonicoli Date: Sun Oct 17 12:09:45 2021 +0200 Fix spelling errors found by Lintian commit 9aa9e719d97ec4dc886946ace3b688674be4144d (G) Author: Pierre-Louis Bonicoli Date: Wed Oct 13 13:13:22 2021 +0200 new release: ensure NEWS file is up to date commit ce67374c0e5844b563559f73c5eb085d7fdba1f7 (G) Author: Pierre-Louis Bonicoli Date: Wed Oct 13 11:40:30 2021 +0200 Synchronize NEWS file & NEWS from project commit 42ccca78493e7a5e342883052aeb18dadc82bae9 (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 21:33:19 2021 +0200 Add -git to version string. commit 49688a5aa19fdf12e7f42b84e5434025399f05e5 (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 21:33:13 2021 +0200 Update version and ChangeLog for bip-0.9.2 release. commit ef70865450a0b0aab4561f8815630d697dd109dd (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 18:53:26 2021 +0200 Fix minor issues in bip sample configuration file commit 9579b5fb3f246cd30a76b618031f7a190f6349c4 (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 18:36:38 2021 +0200 Add missing keywords in vim syntax file Add autojoin_on_kick, backlog_reset_connection, ignore_server_capab, reconn_timer and write_oidentd keywords. commit bffdbe8b1969a57f0dec3da7f3bc4f11487f9059 (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 18:18:27 2021 +0200 backlog_timestamp: update man page & vim syntax Complete 0c1881b9210794821c71380969c54e1034679f21 and 2c7b8aa1550fac97d8a203bcf905bf4c7586fe80. commit a974323a8fb7e846c2d8ab28bd42ab41f7852a56 (G) Author: Pierre-Louis Bonicoli Date: Tue Oct 12 18:40:21 2021 +0200 Fix syntax issue in vim syntax file backlog keywords were ignored due to this issue. commit 12a6dbc352764dbe257a5a1fd4c24bb38ea23b8e (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 18:14:43 2021 +0200 Add -git to version string. commit 1816044070374e710a0c015e8c7b0c852dcf1a75 (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 18:14:37 2021 +0200 Update version and ChangeLog for bip-0.9.1 release. commit 722ed9a8da5470b4b5e75fa140a34cbde409c33b (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 18:06:27 2021 +0200 ENABLED might not be defined: use a default value For example using ENABLED in /etc/default/bip is DEPRECATED in Debian. Closes #618. commit df2a9eab17fc39e2f0da3004b4bc150c848c5d61 (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 14:50:25 2021 +0200 Add -git to version string. commit d0bb1d4dc0db5f9d50d7e43d6375ff1b77d7273d (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 14:50:19 2021 +0200 Update version and ChangeLog for bip-0.9.0 release. commit 0e9e61decb5d2cf5aab85ac3de0b2df12c55d92b (G) Author: Pierre-Louis Bonicoli Date: Mon Oct 11 14:49:17 2021 +0200 Update version and ChangeLog for bip-0.9.0 release. commit 844395db1a0414014f6cdd178c7c73ef30720f6d (G) Author: Pierre-Louis Bonicoli Date: Fri Oct 8 19:22:22 2021 +0200 Update NEWS file: add user facing changes commit 0c1881b9210794821c71380969c54e1034679f21 (G) Author: Pierre-Louis Bonicoli Date: Fri Oct 8 18:02:54 2021 +0200 Deprecate backlog_no_timestamp parameter backlog_timestamp must be used instead. The default behavior is unchanged and can explicitly used with: backlog_timestamp = "time"; The "none" value can be used with the backlog_timestamp parameter in order to use the same behavior that the "no" value of the deprecated parameter backlog_no_timestamp provided. The date can now be displayed (in addition to the time) while backlogging: backlog_timestamp = "datetime"; commit 8b343aa5b0aa43441a7bed943bb8338c31b1fcc7 (G) Author: Pierre-Louis Bonicoli Date: Fri Oct 8 11:57:53 2021 +0200 Merge branch 'allow-customizing-the-timestamp-format' commit 2c7b8aa1550fac97d8a203bcf905bf4c7586fe80 (G) Author: Thomas Vigouroux Date: Thu Oct 7 16:16:02 2021 +0200 Allow customizing the timestamp format commit 1732209c703397e1a9027784c2af559bc3bca7ac (G) Author: Pierre-Louis Bonicoli Date: Fri Oct 8 11:48:18 2021 +0200 Merge branch 'wording_and_typo' commit 3d732651bc2b957d3553f29bf7903a4bdc651b45 (G) Author: Pierre-Louis Bonicoli Date: Thu Oct 7 18:06:10 2021 +0200 Improve wording in error message commit e6547b8a48e11f7e235d241b2edd3a9360929836 (G) Author: Pierre-Louis Bonicoli Date: Thu Oct 7 18:04:17 2021 +0200 Fix a typo (s/LOGING/LOGGING/) commit 75317ae17ce24e8aafe0358125a632226d3b84fc (G) Author: Pierre-Louis Bonicoli Date: Mon May 18 04:47:11 2020 +0200 Add -git to version string. commit 7362a46a0fc6bf30941d13dbca9dfbd9ed9094ff (G) Author: Pierre-Louis Bonicoli Date: Mon May 18 04:47:05 2020 +0200 Update version and ChangeLog for bip-0.9.0-rc4 release. commit 92a1f07c76e69396973fc4015f3285fc5681bb40 (G) Author: Pierre-Louis Bonicoli Date: Mon May 18 04:43:59 2020 +0200 bip-release: update regex Related: c0fafe669d08170b171601d49cf5542a68692a71 commit 63453bad41681d8c7c98ee279f80a16312deb7e5 (G) Author: Pierre-Louis Bonicoli Date: Mon May 18 04:04:06 2020 +0200 Update INSTALL file which refers to README for specific instructions. commit 92819d87eae8ec8076d67a647adbd81d3c29e8b8 (G) Author: Adam Williamson Date: Fri Feb 7 11:20:45 2020 -0800 Fix stringop-truncation error (thanks DJ Delorie) See https://bugzilla.redhat.com/show_bug.cgi?id=1799189. bip build fails on current Fedora Rawhide GCC and glibc. DJ Delorie says "The warning is correct; the code is copying up to the NUL on purpose, then copying the NUL in a separate command. Not sure why." Tom Hughes suggests this as the fix. commit c9cc64f2e1932339ddd08d39261331f6b6ceee71 (N) Author: Arnaud Cornet Date: Tue Dec 25 10:13:54 2018 -0500 Be more consistent when freeing incomplete clients. Cleanup IRC_TYPE_TRUST_CLIENT clients from the connecting client list the same way as IRC_TYPE_LOGING_CLIENT. commit 0044826084a135dc853a3d0643f28cb284723e90 (N) Author: Arnaud Cornet Date: Mon Dec 24 16:58:59 2018 -0500 Don't unbind succesful trusting clients twice. Complements commit 60122ef160bc2bacbd78f7907390a6743bc0c64d. commit 60122ef160bc2bacbd78f7907390a6743bc0c64d (N) Author: Arnaud Cornet Date: Mon Dec 17 22:33:19 2018 -0500 Unbind clients of type IRC_TYPE_TRUST_CLIENT. The clients connection was nulled in irc_closed, but the clients were not removed from the link, which caused a segfault on successful connection. https://projects.duckcorp.org/issues/637 commit 814d54c676d5827f6ea37c1cd2d6e846d080c13c (Y) Author: Pierre-Louis Bonicoli Date: Wed Dec 12 03:02:21 2018 +0100 use strftime instead of snprintf wherever possible commit a86b73ab03711b1bc8eb8b2d0a2dd47aac813413 (Y) Author: Pierre-Louis Bonicoli Date: Wed Dec 12 02:05:14 2018 +0100 reuse AM_CFLAGS wherever needed commit e5005cea341fea813c44f5e8d7b411bfec6be4be (N) Author: Arnaud Cornet Date: Tue Dec 11 19:46:38 2018 -0500 Cleanup the network properly when we fail to load. commit 16f2be6ac268809b67e204463dfbdfcb9a52b023 (N) Author: Arnaud Cornet Date: Tue Dec 11 19:37:36 2018 -0500 Give up loading invalid configurations. Bip does not know how to deal with a network with no server. Simply prevent loading such bad configs. Fixes: https://projects.duckcorp.org/issues/611 commit 09053fc5f037e5b29a599681e89627983b744bfe (Y) Author: Pierre-Louis Bonicoli Date: Tue Dec 11 11:12:08 2018 +0100 CFLAGS: use -W{all,extra,error} by default again commit 1f8a8763cb1ba01ed8eeb28515b890b97de89c9b (Y) Author: Pierre-Louis Bonicoli Date: Tue Dec 11 11:09:25 2018 +0100 '-Wall -Werror' automake switches are used by default since c0fafe669d08170b171601d49cf5542a68692a71 commit c93a7e841a62b8b47a3fb98ce529d39052f140b5 (Y) Author: Pierre-Louis Bonicoli Date: Mon Dec 10 00:38:29 2018 +0100 Fix a typo commit 843cf3738e117119c506cc447baf251b1921d5b9 (Y) Author: Pierre-Louis Bonicoli Date: Mon Dec 10 00:17:14 2018 +0100 oidentd is a runtime option: update doc & script commit 65406960aa54239607b527603479e9e03ba54552 (N) Author: Arnaud Cornet Date: Sun Dec 9 20:05:40 2018 -0500 Merge remote-tracking branch 'origin/master' commit df5508eed053c72cda91ae7dfe3d216512695336 (N) Author: Arnaud Cornet Date: Sun Dec 9 19:52:46 2018 -0500 Deal more gracefully with long home directories. This is a better fix for: https://projects.duckcorp.org/issues/636 commit 87192685f55856d2c28021963ab2c308e21faddc (N) Author: Arnaud Cornet Date: Sun Dec 9 19:40:36 2018 -0500 Fix gcc-8 warning. Change weird use of strncpy where we know we will truncate and use an extra byte copy instead. commit d2dcb0adb1aa8c2c4526aa6ad650483b0e02ab7d (N) Author: Arnaud Cornet Date: Sun Dec 9 19:27:56 2018 -0500 Fix warning with gcc-8. Fixes: https://projects.duckcorp.org/issues/636 commit 02c55a37b2cd9561a57ed3869ca147cbb1644ff3 (Y) Author: Pierre-Louis Bonicoli Date: Wed May 30 03:34:12 2018 +0200 add debug log & differentiate error messages commit e224f067c1d26c067ed80cd9f94377dbbb878933 (Y) Author: Arnaud Cornet Date: Sun Dec 9 16:06:18 2018 -0500 Fix the conditional build of tests again. Per [1], you always output the optional directory Makefile. [1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories-with-AM_005fCONDITIONAL.html#Subdirectories-with-AM_005fCONDITIONAL commit 936b76690596a37fa1c4143f1ca382ccfa974770 (Y) Author: Arnaud Cornet Date: Sun Dec 9 15:08:58 2018 -0500 Make the tests subdirectory optional. Otherwise build breaks when check is not installed. commit caf979a4c5b0205068b61ba6628bb679823068fd (Y) Author: Arnaud Cornet Date: Sun Dec 9 14:27:59 2018 -0500 Close descriptor when SSL reports a system error. Avoids leaking fd when connections are closed abruptly. commit 513a6582ad2cb395e40b5597b38fcdbb8751b695 (Y) Author: Arnaud Cornet Date: Sun Dec 9 14:04:43 2018 -0500 Add CFLAGS needed for openssl. Otherwise building fails in platforms with esoteric openssl locations. commit ba5cef017cdd5cb579589c7c0f3f8b8938532a62 (Y) Author: Arnaud Cornet Date: Fri Nov 30 09:00:51 2018 -0500 Fix test automake file to link openssl. commit 2bf967bacc58192c92604462b7a5ee704b98a605 (Y) Author: Arnaud Cornet Date: Sun Nov 18 15:37:46 2018 -0500 Add missing OpenSSL CFLAGS/LDFLAGs to build. Those were removed by mistake in the previous autotool refactor. commit 34a92dedb1609bf816b9e11c7993160a87560463 (Y) Author: Arnaud Cornet Date: Sun Nov 18 15:07:16 2018 -0500 Remove OIDENTD build options. Instead support a runtime option. Note that existing oidentd users will have to add write_oidentd = true in their config to keep existing behavior. commit 7844716af5d1c655989afbfc0c3cc12665e3884b (Y) Author: Arnaud Cornet Date: Sun Nov 18 14:30:17 2018 -0500 Fewer configure options. Use pkg-config to detect openssl. Eagerly use backtrace if provided by libc. commit 87f34153303becc9eeef5d331992b67557ce9a46 (Y) Author: Arnaud Cornet Date: Sun Nov 18 14:23:06 2018 -0500 Fewer build options. Eagerly depend on openssl and check, build degraded without. commit c0fafe669d08170b171601d49cf5542a68692a71 (Y) Author: Arnaud Cornet Date: Sun Nov 18 09:10:16 2018 -0500 Simplify autotools configuration. commit a80e74bbdc84862342441e0c5bfb3c22faf4d534 (Y) Author: Arnaud Cornet Date: Sun Nov 18 08:19:26 2018 -0500 Add .clang-format file. commit fabaec9d807e9ac106790f282953ffa5c3aa055a (Y) Author: Arnaud Cornet Date: Sun Nov 18 08:18:42 2018 -0500 More files in .gitignore commit e222e1c986ef136b31d98dd444d3ea96827b4bea (Y) Author: Arnaud Cornet Date: Sun Nov 18 08:15:31 2018 -0500 Add .gitignore. commit 0b8269e2d31a6aaabeae850b168cc990621dbbbd (N) Author: Arnaud Cornet Date: Sun Dec 9 16:06:18 2018 -0500 Fix the conditional build of tests again. Per [1], you always output the optional directory Makefile. [1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories-with-AM_005fCONDITIONAL.html#Subdirectories-with-AM_005fCONDITIONAL commit e27b84f15e9e841a7771d86f73640eaaa8c3cbcf (N) Author: Arnaud Cornet Date: Sun Dec 9 15:08:58 2018 -0500 Make the tests subdirectory optional. Otherwise build breaks when check is not installed. commit 4d7f2437779464e54353b19f26a001b63883a6ef (N) Author: Arnaud Cornet Date: Sun Dec 9 14:27:59 2018 -0500 Close descriptor when SSL reports a system error. Avoids leaking fd when connections are closed abruptly. commit 2fd3418a9e37b34808bbcdd449be4309d54328a8 (N) Author: Arnaud Cornet Date: Sun Dec 9 14:04:43 2018 -0500 Add CFLAGS needed for openssl. Otherwise building fails in platforms with esoteric openssl locations. commit b963308e6c8d7b34c17016cb8a2ee5e5c14d64a4 (N) Author: Arnaud Cornet Date: Fri Nov 30 09:00:51 2018 -0500 Fix test automake file to link openssl. commit fbde1552870226687ed1e0d6b9b584c987bc0173 (N) Author: Arnaud Cornet Date: Sun Nov 18 15:37:46 2018 -0500 Add missing OpenSSL CFLAGS/LDFLAGs to build. Those were removed by mistake in the previous autotool refactor. commit 012b21a68b5cc0532a621996abe3d011b2e89b66 (N) Author: Arnaud Cornet Date: Sun Nov 18 15:07:16 2018 -0500 Remove OIDENTD build options. Instead support a runtime option. Note that existing oidentd users will have to add write_oidentd = true in their config to keep existing behavior. commit 40233ff9388d4f85fdf348c379e2ebf289d85904 (N) Author: Arnaud Cornet Date: Sun Nov 18 14:30:17 2018 -0500 Fewer configure options. Use pkg-config to detect openssl. Eagerly use backtrace if provided by libc. commit 7dec6b3072341aa338d4cc3952879df57e5aa09b (N) Author: Arnaud Cornet Date: Sun Nov 18 14:23:06 2018 -0500 Fewer build options. Eagerly depend on openssl and check, build degraded without. commit 27f1cf988bdc421c285461bd91e4ae1995356db8 (N) Author: Arnaud Cornet Date: Sun Nov 18 09:10:16 2018 -0500 Simplify autotools configuration. commit 1e80291b9c091635b9016cb4f4532d8ca0d76331 (N) Author: Arnaud Cornet Date: Sun Nov 18 08:19:26 2018 -0500 Add .clang-format file. commit 362ec25e4bec19f079a91a10358ac43220c77411 (N) Author: Arnaud Cornet Date: Sun Nov 18 08:18:42 2018 -0500 More files in .gitignore commit f4ac33f63c376970fe59f962e35940e949c51c4c (N) Author: Arnaud Cornet Date: Sun Nov 18 08:15:31 2018 -0500 Add .gitignore. commit aa35b372b47c7736a9efa6c6703ed1ffd23b1c36 (Y) Author: Arnaud Cornet Date: Mon Nov 12 22:55:58 2018 -0500 Add unit tests. Add an optional build dependency on check and add an initial test case. commit 34711f765339e3ec8548c06665feb5da713a649e (Y) Author: Arnaud Cornet Date: Sun Nov 11 18:16:14 2018 -0500 Move automake file in src subdir, isolate main. In preparation for adding a unit test directory, move Makefile.am in src, and build a static libbip before linking a binary. commit 53dafd9590ff110b81e1847d01d53b9b022554d2 (N) Author: Arnaud Cornet Date: Mon Nov 12 22:55:58 2018 -0500 Add unit tests. Add an optional build dependency on check and add an initial test case. commit 057107a2332e73ddbc969d2e74a29d8f8f5c36ee (N) Author: Arnaud Cornet Date: Sun Nov 11 18:16:14 2018 -0500 Move automake file in src subdir, isolate main. In preparation for adding a unit test directory, move Makefile.am in src, and build a static libbip before linking a binary. commit b75345d6b552a3d06b21c843219393245ab7c4d3 (Y) Author: Pierre-Louis Bonicoli Date: Tue Mar 27 00:14:12 2018 +0200 Add -git to version string. commit cf144594a00ba2820ede56c328489a30a6d80b37 (Y) Author: Pierre-Louis Bonicoli Date: Tue Mar 27 00:13:57 2018 +0200 Update version and ChangeLog for bip-0.9.0-rc3 release. commit eaed46da1485ea81556ad255d7d56dc33daf1913 (Y) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:38 2018 +0100 Merge branch 'path_test_use_stat' commit 025689d8074b13f5229ee99b95190437194bae53 (Y) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:23 2018 +0100 Merge branch 'dh_param_not_mandatory' commit 948b41ef7a09b751df22bbd1c8f28b7bbe405a18 (Y) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:10 2018 +0100 Merge branch 'fix_path_construction_issue' commit 7834471f78c1af516df4bdbc193a805582e9f7fa (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 21 11:32:46 2018 +0100 default value isn't used when path doesn't exist commit 13b2e3763541fc5045bbc09f14a5b0aae51558d0 (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 21 11:12:21 2018 +0100 DH parameters are not always required for example ECDHE ciphers doesn't require DH parameters. Closes #499 commit 3afb16d795073d2aff9e2253619757a4e1e6e77c (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 21 11:54:20 2018 +0100 checking path: use stat fopen was used because it's stdlib but stat is already used in other parts commit 348737fab5c6529ba636056d40ec42f2cb18dd96 (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 21 11:07:56 2018 +0100 Fix path construction Thanks to Renzokuken for pointing that ! Closes #610 commit 385be75f7e904394dc4c9cccca9656c20c4c44f4 (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:26:34 2018 +0100 Add -git to version string. commit 8ceebf1fd882f855d46a3d1d45dddbf50a357111 (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:25:59 2018 +0100 Update version and ChangeLog for bip-0.9.0-rc2 release. commit 901f54eff0f647442923f2ccf6f470f22e4c5ffe (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:09:25 2018 +0100 Merge branch 'username_disallow_duplicate' commit 96f0403a2ab2f5df63b4e1f584a1bd9879be1339 (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:08:26 2018 +0100 remove useless calls to FREE MOVE_STRING macro is used in order to initialize parameters, this macro calls free when necessary. commit 83d7f2acbe3ef464815b8f73e35fd8fc252a0421 (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:07:38 2018 +0100 Add missing call to MAYFREE commit dbe19d938775121e8557068fd3254894f2178684 (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 1 14:14:35 2017 +0100 Handle no defined users commit 903a88e58977cde81b894d106354bbd74fc26a99 (Y) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 19:59:06 2018 +0100 Merge branch 'systemd' commit 866552e102d4918735daa9c48eaef764ca201799 (Y) Author: Pierre-Louis Bonicoli Date: Wed Mar 1 09:18:23 2017 +0100 sample conf: on_connect_send can be used more than once commit aad87daa9e65a5cab8bf0157c22a1593dbdaad9c (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:23:21 2017 +0100 sample conf: reformat commit 6d3bff19693047e752b9e649a03946402d6bfdf8 (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:22:53 2017 +0100 sample conf: remove trailing spaces commit 97e19a52158ae25352fa84b4b5f29379904aa088 (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:21:52 2017 +0100 sample conf: comment the whole file commit a31cbe45fabc4970faef2522e63ad24e619150ad (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:17:34 2017 +0100 bipmkpw man page: mention bip man page commit 072a17b55b61ef95148fdcd4ab467038b88d74fd (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:11:19 2017 +0100 bip.conf manpage: improve formatting - follow man-pages conventions - HTML output produced by groff is more readable commit cdbf22cdb7d40ac25e30ff7b4ae93fb108f14647 (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:10:03 2017 +0100 bip.conf manpage: mention default of ciphers related options commit 3b9f683d31c8ba928df636c554e5cafc0c12cdec (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:08:03 2017 +0100 bip.conf manpage: fix doc of 'ip' option commit 09152a1a7d479e0c76c9ae2fea75ddeb9bb0f0ff (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:07:07 2017 +0100 bip.conf manpage: new section 'IRC CLIENT CONF' commit 11482caa95fafe5201107060ac334ad6b03f4275 (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:02:25 2017 +0100 bip.conf manpage: add a SYNOPSIS section commit b474f55e8ae7c57ee4dbfe71f1b64dc8e42139e5 (Y) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:00:49 2017 +0100 bip manpage: mention -s switch in SYNOPSIS section commit af46159275c3e533a4c02326ffa80a673a4bcdc3 (Y) Author: Pierre-Louis Bonicoli Date: Thu Feb 23 16:56:17 2017 +0100 Sample config file: add default values commit e52df8d08615f55d58011a720aadaecd1769a104 (Y) Author: Pierre-Louis Bonicoli Date: Wed Feb 15 16:41:59 2017 +0100 sample.conf: use /run instead of /var/run commit 3f4a260a54b6bf8812310c3d3c320d559b8c0374 (Y) Author: Pierre-Louis Bonicoli Date: Wed Feb 15 16:03:15 2017 +0100 Add systemd unit files Largely inspired by https://lwn.net/Articles/584175/ "They must be suitable for every distribution to use." Packagers must define: - ExecStart=/path/to/bip_env.sh - Environment=BIP_DEFAULT_CONFIG='/path/to/default/bip' using a unit file drop-in bip-config.service.d/.conf commit 554c372452692a88a7d8aeee93f6f4f4d41b6e96 (Y) Author: Pierre-Louis Bonicoli Date: Wed Jul 26 03:41:10 2017 +0200 Sign commits created by release script commit 2ecd82f0112e6d57e8651296d624975aa56e03a4 (Y) Author: Adam Williamson Date: Tue Jul 25 13:08:38 2017 -0700 Fix some 'const const char' declarations That's one two many consts...recent GCC blips on this. Signed-off-by: Pierre-Louis Bonicoli commit 0e6444198b98d6cdcc4d6106b1f11196d068e410 (N) Author: Pierre-Louis Bonicoli Date: Sat Nov 12 01:36:22 2016 +0100 Add -git to version string. commit 19c1b631ea2e538d0d3dfac874d569b3da4b06a4 (N) Author: Pierre-Louis Bonicoli Date: Sat Nov 12 01:36:21 2016 +0100 Update version and ChangeLog for bip-0.9.0-rc1 release. commit 2e81cca480ed74abf8559d7e1bbe52f6be273786 (N) Author: Pierre-Louis Bonicoli Date: Sat Nov 12 00:52:50 2016 +0100 Check value returned by X509_OBJECT_new() Reported by Alexander Couzens, thanks to him ! commit e452c023ad83b4e88c5b09fef501ab82e7058bf7 (N) Author: Pierre-Louis Bonicoli Date: Sat Nov 12 00:58:18 2016 +0100 X509_OBJECT_new: call X509err mimic behavior of X509_OBJECT_new provided by OpenSSL >= 1.1 commit 6b3844987509517dad6e41391d9142b867266b8b (N) Author: Pierre-Louis Bonicoli Date: Tue Jul 5 09:18:07 2016 +0200 Allow to set DH parameters commit 5db61f3982780d50f7a3e036c3814d99c35995ad (N) Author: Pierre-Louis Bonicoli Date: Wed Jun 29 19:55:27 2016 +0200 Allow to set oidentd path commit e8b5d02f132627bb8b6a985d9d908fe31f9d7f71 (N) Author: Pierre-Louis Bonicoli Date: Wed Apr 13 01:15:43 2016 +0200 Add missing call to SSL_CTX_free commit 406ebacfe5ab8fbd5747d08a6eab3d43d45709e2 (N) Author: Pierre-Louis Bonicoli Date: Wed Apr 13 01:14:36 2016 +0200 check value returned by SSL_CTX_new commit 30270bc8e85ca2d7ccf4f1f0bf2babb91983489b (N) Author: Pierre-Louis Bonicoli Date: Wed Apr 13 01:13:11 2016 +0200 sample configuration: add per connection log parameter commit ab8e5eece1a80c9096de1c8abd9dc2a447548287 (N) Author: Pierre-Louis Bonicoli Date: Wed Apr 13 01:04:33 2016 +0200 Add cipher specifications setting Allow to configure cipher specifications for the listening bip connection and for each outgoing IRC connection. Closes #301 commit 20f39abc5680cd1b3d97359cfeb61a9b65f5b836 (N) Author: Pierre-Louis Bonicoli Date: Mon Nov 30 10:59:32 2015 +0100 bipdir improvements - more documentation - don't die if environment variable $HOME isn't defined but '-s' parameter is used - oidentd: change path, file is located in bipdir commit 39414f8ff9df63c8bc2e4eee34f09f829a5bf8f5 (N) Author: Pierre-Louis Bonicoli Date: Wed Jun 29 19:40:32 2016 +0200 Handle OpenSSL version 1.1 adding forward-compatible code to older versions commit 148b38a95398e7766b11549d9c0a34f2982b8bcf (N) Author: Pierre-Louis Bonicoli Date: Thu Sep 10 18:47:53 2015 +0200 Prefixes and usermodes were inverted commit 209b9a7cd756f9857f5ccdd3b6e7d24531cdac31 (N) Author: Pierre-Louis Bonicoli Date: Thu Sep 3 05:40:58 2015 +0200 Add missing terminating null byte Reported by Trou, thanks to him ! Closes #477 commit 5594e69bf6fd140dc159d791ce107b6b8b674ee6 (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 23:20:30 2015 +0200 Use a new logfile when day changed commit bdec94020eb8bd764c049f1d77b087919867a1bf (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 11:49:30 2015 +0200 Use monotonic time commit 34baf6e8418a2a999aa45da889a11ecddc2abdf3 (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 11:49:30 2015 +0200 Always call bip_tick when select timeout commit 9df25a64237e91c46484b29072ca8cb2c9ba0edc (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 11:49:30 2015 +0200 Reformatting commit ddf79583534b2a2206561a69d0b16572c913d6de (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 13:18:27 2015 +0200 Use AC_RUN_IFELSE instead deprecated AC_TRY_RUN commit fbb285fc919af2eccc26ed0420592bcfc94fbc73 (N) Author: Pierre-Louis Bonicoli Date: Fri Jul 10 13:18:01 2015 +0200 Update AC_PREREQ entry: bump to 2.69 commit 4eec0844521fd52b6dec8edd67bf5ea3a5082092 (N) Author: Pierre-Louis Bonicoli Date: Thu Dec 11 17:20:14 2014 +0100 Allow to configure the delay before a reconnection Initial patch submitted by Romain Gayon, thanks to him ! commit 73483ff08880b2bfee17b424d1e9db3cacfb4831 (N) Author: Pierre-Louis Bonicoli Date: Fri Sep 26 14:59:57 2014 +0200 Handle PREFIX defined in ISUPPORT ISUPPORT is a de facto standard extension to IRC. Available prefixes and usermodes are handled at the connection level (link_level struct). commit e88d7da7602ee583da7b01f0a956d70027721b95 (N) Author: Pierre-Louis Bonicoli Date: Sat Sep 20 17:57:39 2014 +0200 Handle CHANMODES defined in ISUPPORT ISUPPORT is a de facto standard extension to IRC. chanmodes are handled at the connection level (link_level struct). commit fda9fccb855efebef816b5976bd9f47e78dd0ffa (N) Author: Pierre-Louis Bonicoli Date: Tue Sep 16 02:50:04 2014 +0200 Handle unlikely case: "CAPAB" present twice If "CAPAB" element were present twice, a wrong element would be removed. commit db27168c76b028170312cbe75816de86f82bb66d (N) Author: Pierre-Louis Bonicoli Date: Tue Sep 16 02:40:45 2014 +0200 Avoid unnecessary test The first element is "005", it cannot be "CAPAB". commit f7ace64abec430b97a26c2e377f2bb412da001dd (N) Author: Pierre-Louis Bonicoli Date: Tue Jul 15 02:31:19 2014 +0200 Remove dead links from the list of all links Fix segfault that occurs when bip admin users use: /BIP DEL_CONN /BIP ADD_CONN Closes #325 commit 88242715f489850a1f7cad6064492668c84f5083 (N) Author: Adam Williamson Date: Fri Sep 19 18:04:53 2014 -0700 allow for certificate store to be unspecified in CA mode In many cases, using OpenSSL's default certificate store is fine and even preferred. If your OpenSSL provider (e.g. your distribution) is competent, they will manage this database better than you likely will. With this change, bip will attempt to use the default certificate store if you set CA mode but do not specify a certificate store location. This could be refined to test after enabling the default paths whether the certificate store is empty, and error/warn if so. commit 89295ca4b2b89f88b4ce52fd78f0033a34906d90 (N) Author: Adam Williamson Date: Fri Sep 19 13:01:53 2014 -0700 check whether trust store is a file or directory in CHECK_CA The existing code only allows you to provide a set of trusted CA certificates as an openssl 'CApath'-type directory. Fedora, RHEL (and derived distros) and probably other distros provide a system-wide database of trusted CA certs in various bundle formats, but not as a CApath-type directory. This checks whether check_store is a file or directory and loads it appropriately, when initializing an SSL connection. Note that there is code elsewhere which assumes the trust store will be a file, but that code is hit only in CHECK_BASIC mode. This change applies only to CHECK_CA mode. commit e0b63528f23a6da3245babf8ae6394b3ab59c3b1 (N) Author: Pierre-Louis Bonicoli Date: Wed Sep 3 02:18:02 2014 +0200 Channel modes: 'Type B' flags always have a value even when removed. Refs #345 commit d2fa844960630bf80048b20100fa5f4db672dd33 (N) Author: Pierre-Louis Bonicoli Date: Mon Sep 1 16:49:29 2014 +0200 Channel mode: handle flags 'f' and 'j' Closes #345 commit 8d3539a7d0eed8f9074eb5ec42c9f9d39d6b4af4 (N) Author: Pierre-Louis Bonicoli Date: Mon Nov 4 08:49:06 2013 +0100 Fix --without-openssl build Reported & fixed by Whoopie, thanks to him ! Closes #313 commit acfad6dee2be7c8b9325af77740f4e2e593f2eeb (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 15:58:19 2013 +0200 Add -git to version string. commit a6e29858879a27152b4ed9a4f3bbcffb70346826 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 15:58:14 2013 +0200 Update version and ChangeLog for bip-0.8.9 release. commit c34b030e217fbd3b7cb5d425015a40f5eebd5943 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 14:57:15 2013 +0200 bip-release script can now handle an optional release name This release name is used in the git tag. The previous 'release' variable was renamed in 'release_version' to avoid confusion. commit ca4dd55e71ab91791fdf0db2cef2a6db543118c4 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 13:34:15 2013 +0200 Use full year in dev tarball name made by bip-release commit d9461b8c8d0ac5f757a52fef8eb95fc7e5dd4fe5 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 13:28:42 2013 +0200 make_distcheck in bip-release needs to prepare sources commit b6d9151e8c866867b593fcc6388a576410a7c509 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 13:07:45 2013 +0200 Corrected AC_INIT: package and tarname were inverted commit 400cfedb6ca8feb6ab3cd15bb7b041aa17ba943d (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 12:52:04 2013 +0200 Sign release tags Closes #270 commit 1c3ef1d360c2db1902f5f04415192c123ba4c378 (N) Author: Marc Dequènes (Duck) Date: Sat Oct 19 11:53:13 2013 +0200 Really ensure a Yacc alternative is installed at build time AC_PROG_YACC falls back to YACC = "yacc" if bison or byacc are not found, but it does not mean it is present. Closes #294 commit 8b98c3746e625c41f84816f75fd3297a74609b25 (N) Author: Marc Dequènes (Duck) Date: Fri Oct 18 17:31:47 2013 +0200 Compatibility fix with bison 2.6 Bison 2.6 now declares yyparse in the generated header. This fix ensure it still works for older versions. Reported in Debian#710614 commit 71801fb3d2d7e429fe350298006c5fdae28e4478 (N) Author: Nathan Phillip Brink Date: Mon Jul 8 12:18:03 2013 +0200 Throttle almost everything (except PING, PONG, and certain QUIT messages) sent to the IRCd. Fixes being killed for Excess Flooding on freenode by using the existing fakelag mechanism. The existing fakelag works great but was just not hooked into earlier. Closes #191 commit aa4ee44d68f16173cfdb76a3c9db602be0bd48c3 (N) Author: Pierre-Louis Bonicoli Date: Sun Jul 7 19:29:28 2013 +0200 Remove useless bootstrap script Refs #284 commit 2c390390ed90d4baa27a8d75762c4868bdf65e84 (N) Author: Pierre-Louis Bonicoli Date: Sat Jan 7 12:28:47 2012 +0100 Password cannot contain spaces. Closes #265. Thanks to Tim Hansen for reporting this bug. commit df45c4c2d6f892e3e1dec23ce0ed2575b53a7d8c (N) Author: Pierre-Louis Bonicoli Date: Wed Jan 25 05:08:52 2012 +0100 Closes #261. Fix by Thijs Alkemade. - use conf_global_log_file instead of stderr - when a SSL handshake error occurs, close socket commit f1bec50a9cc81417344f62e021e14c0a254737d6 (N) Author: Pierre-Louis Bonicoli Date: Wed Jan 25 04:03:18 2012 +0100 Revert f19e1f6. Fix #252. f19e1f6 introduces a regression (#252) and bug described in commit message can not be reproduced. commit 222a33cb84a2e52ad55a88900b7895bf9dd0262c (N) Author: Pierre-Louis Bonicoli Date: Sat Jan 7 11:41:02 2012 +0100 Buffer Overflow: check against the implicit size of select() arrays Reported by Julien Tinnes (Fix #269) exit is called when the listening socket can not be created commit 0ed5240de5dce0730c9ebaedff6aa874c68fb671 (N) Author: Pierre-Louis Bonicoli Date: Fri Jan 20 05:27:28 2012 +0100 doc: automake,autoconf-archive:deps, add bootstrap - build dependencies: add automake & autoconf-archive - mention 'bootstrap' script commit 7fef65fbe84753b50b4df9ec938a906c33bd2853 (N) Author: Pierre-Louis Bonicoli Date: Tue Oct 25 01:17:54 2011 +0200 use maintainer mode when building from a repo try CFLAGS="-Wno-error" if build failed commit 975ccac0b13ad5fb71779da39ecd88a822d5474e (N) Author: Pierre-Louis Bonicoli Date: Mon Oct 24 23:45:01 2011 +0200 delete generated file commit a46b8bd2c2c3683d1aa40656123c7f15d6a53b3c (N) Author: Arnaud Fontaine Date: Mon Oct 3 15:25:26 2011 +0900 Fix GCC warnings. commit ab0a41b7bb529386a2a9e6cc29faddf46d7dfea2 (N) Author: Arnaud Fontaine Date: Tue Oct 4 11:15:12 2011 +0900 Add AM_MAINTAINER_MODE for vendors. commit 6103f8bc84d7231b4a7064e29f305cb1779ced59 (N) Author: Pierre-Louis Bonicoli Date: Tue Oct 4 00:47:22 2011 +0200 CFLAGS: add -Werror commit 0da434d126ddaeef80a92acddf3e7d2fab28b642 (N) Author: Arnaud Fontaine Date: Mon Oct 3 15:25:26 2011 +0900 Fix GCC warnings. commit 559fa7ed44238e811ac0c11321ed021c35cba2be (N) Author: Pierre-Louis Bonicoli Date: Wed Sep 14 06:30:09 2011 +0200 don't override user var. Thanks to Alex Legler Based on gentoo-x86/net-irc/bip/files/bip-configure.patch See http://www.gnu.org/software/autoconf/manual/automake.html#User-Variables If user doesn't specify CFLAGS, default value is "-Wall -Wextra -g -O2". commit 7e1c80a65a0516312985349104068ed771425ccd (N) Author: Nathan Phillip Brink Date: Tue Sep 13 02:55:17 2011 +0000 Use 'make dist' instead of 'git archive' to create a release or snapshot tarball. commit 84fa6c7eb0f5b81a28ee88ca45f22d210e0c3d16 (N) Author: Pierre-Louis Bonicoli Date: Mon May 23 04:36:58 2011 +0200 Fix typo in assertion message commit b2dde370d679378638a691547c2a2afb7d7b27bc (N) Author: Pierre-Louis Bonicoli Date: Mon May 23 04:01:27 2011 +0200 Improve 'trust ok' command if a client send "TRUST OK" to bip and all connexions are already trusted, reply "No untrusted certificates." instead of "Unknown command" commit 46c599d92ed7b8fdfae4ca224f5dd99c6e5d6d31 (N) Author: Pierre-Louis Bonicoli Date: Tue Apr 12 02:14:20 2011 +0200 Add -git to version string. commit e730a96cd8ee64ff438bfde3c231ebd9a4c2d4d6 (N) Author: Pierre-Louis Bonicoli Date: Tue Apr 12 02:14:18 2011 +0200 Update src/version.h and Changelog for release. commit f19e1f6209387e221a7f2535937f76dfc4938e60 (N) Author: Pierre-Louis Bonicoli Date: Tue Apr 12 01:08:41 2011 +0200 Fix backlog of queries when option 'log' is False Issue #212 commit 87da44e5830c31e50b50d18e592c715e327034c2 (N) Author: Yoann Guillot Date: Tue Apr 5 23:43:05 2011 +0200 connection: allow to disable / enable log (#211) add option 'log' (true/false) in connection section, this option overrides the global 'log' option. Thanks to jj ! commit 2e49437ed7f5eba164316a5a8f0af0dcb4ec3718 (N) Author: Pierre-Louis Bonicoli Date: Wed Jan 26 21:47:12 2011 +0100 revert 4fdabdd166270f00513dc7e3077dce1bbb5c16c2 better quick fix commit 81b8ed48cfdece35ff433c07a1febd6750652fd9 (N) Author: Pierre-Louis Bonicoli Date: Sat Jan 15 17:53:46 2011 +0100 Fix build errors on armel sys/user.h on armel has a conflicting definition of 'struct user'. This patch renames bip's structure to avoid the conflict. Thanks to Philipp Kern and Dann Frazier ! commit 4d4710acb955530694f2434d95ed887d7b96ada7 (N) Author: Pierre-Louis Bonicoli Date: Tue Dec 28 03:22:19 2010 +0100 Fix "FATAL: list_remove: item not found" Thanks to Jean-Edouard Babin for reporting it. How to reproduce: 1) connect to bip with an irc client using username (eg 'Pilou') 2) disconnect irc client 3) in client configuration, change the case of username (eg 'pilou') 4) reconnect to bip -> bip log FATAL message and exit If old nick and new nick are equal ignoring the case of the characters, don't delete store associated with old nick: only rename it. commit ca1b383a7476f556e3f356526d083fa2677b45ef (N) Author: Pierre-Louis Bonicoli Date: Tue Dec 28 03:20:01 2010 +0100 check return value of hash_get commit 4fdabdd166270f00513dc7e3077dce1bbb5c16c2 (N) Author: Pierre-Louis Bonicoli Date: Tue Dec 28 03:18:13 2010 +0100 filename is NULL if !store && !conf_log commit 0b7a3e6a07931aa6ea9e91c8462c8c8b0bcaeb17 (N) Author: Arnaud Cornet Date: Sun Sep 12 17:48:00 2010 +0100 Add -git to version string. commit ec078131ea13b75cb68c6e08d2074cbd649bb33d (N) Author: Arnaud Cornet Date: Sun Sep 12 17:47:57 2010 +0100 Update src/version.h and Changelog for release. commit 7fb0823167af8e9a826f99b0a18539acc6cd81ec (N) Author: Arnaud Cornet Date: Sun Sep 12 17:32:55 2010 +0100 cp commit 4822364c0fd6cda525d531c156359d57860191c5 (N) Author: Arnaud Cornet Date: Sun Sep 12 16:52:00 2010 +0100 Fix for null pointer deference CVE-2010-3071 commit d0ee9df3eccdbef9856bd2952c0bfa7caf6f5067 (N) Author: Arnaud Cornet Date: Sat Aug 7 12:18:59 2010 +0100 Add -git to version string. commit 3c6d7765970259925024a4cf2b53ed05d154402e (N) Author: Arnaud Cornet Date: Sat Aug 7 12:18:53 2010 +0100 Update src/version.h and Changelog for release. commit 4f5f08677f0e5e7fd42b579fa5bafe73d12430d9 (N) Author: Arnaud Cornet Date: Sat Aug 7 12:10:32 2010 +0100 Enable PIE executable creation. commit 7712ae3a926a3ac1860238988c4fc9b84822cf11 (N) Author: Trou Date: Tue Jun 15 23:02:01 2010 +0100 Fix typo commit 4d3ee53e7bde06239cf25fcc199d71ec69ec7275 (N) Author: Zach Wily Date: Wed Apr 7 22:12:26 2010 +0100 RFC 1459 specifies that the PONG message may have 1 or 2 parameters. commit f995c1f53751724e653f5755da2137ea468a1fc9 (N) Author: Arnaud Cornet Date: Wed Feb 17 12:34:57 2010 +0000 try to mitigate freenode antiflood throttling commit 4d5ef343253f205a4f3eb9150d4c93a22b720e46 (N) Author: Arnaud Cornet Date: Wed Feb 17 12:33:05 2010 +0000 oidentd is not debug commit 92365874d45693cd7c34290133ade5b0873430ce (N) Author: Arnaud Cornet Date: Wed Feb 17 12:32:22 2010 +0000 Revert "Fix antiflood. Fixes freenode kicking us out." This reverts commit 639e929021a1095208ff4d0dc0ffc931fb0efa38. commit 5c3f22d8a84b0fcd45ba192026d1bc1fbbbc75ec (N) Author: Arnaud Cornet Date: Wed Feb 17 12:32:15 2010 +0000 Revert "Unbraindead" This reverts commit b21c658b8cec8cebfb7de52f6ecb9c50e263fb89. commit b21c658b8cec8cebfb7de52f6ecb9c50e263fb89 (N) Author: Arnaud Cornet Date: Wed Feb 17 12:00:55 2010 +0000 Unbraindead commit 5b26dac4898f76ba0396fbbc87cf528ee8d99d8d (N) Author: Arnaud Cornet Date: Wed Feb 17 10:55:09 2010 +0000 More lose MODE command handling commit 5d6b7fedaf90624f3039a7d48a23ce2f98164180 (N) Author: Mathieu Pillard Date: Tue Feb 16 10:08:27 2010 +0000 backread_hours is in hours, not days commit 7c0b6036f2331b601e58bfff5773ad8dec686860 (N) Author: Arnaud Cornet Date: Mon Feb 15 14:22:00 2010 +0000 Ugly header fixups to fix build commit 2e5f4287ff1f6ac446e47670db17800ab08abecd (N) Author: Mathieu Pillard Date: Mon Feb 15 14:17:44 2010 +0000 With necessary header fix commit c0772f54bfc9e85f9c37f4fe4c5ae9b8c58e6d8f (N) Author: Mathieu Pillard Date: Mon Feb 15 14:16:08 2010 +0000 Fix time parsing. Fixes backlog replaying one month to many, commit 639e929021a1095208ff4d0dc0ffc931fb0efa38 (N) Author: Arnaud Cornet Date: Mon Feb 15 14:06:50 2010 +0000 Fix antiflood. Fixes freenode kicking us out. commit bfe14ebb201f4fc7a48cf250d0c4048244d89559 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:41:59 2009 +0000 Add -git to version string. commit ce506aaec771abffa65c7227734f3de51de99305 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:41:56 2009 +0000 Update src/version.h and Changelog for release. commit a932cc53a91df6651e673b20d4de14a6bff02114 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:40:17 2009 +0000 [BUILD] Attempt to fix autostuff commit 944f18962a1a4e937db9d689a80c0b3958ec6301 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:21:27 2009 +0000 Add -git to version string. commit 06a67e08af30d9b10d0707096d47ceb59b27fc39 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:21:24 2009 +0000 Update src/version.h and Changelog for release. commit 03ee43ca89edaf4dfa79412dc91aa89694634445 (N) Author: Arnaud Cornet Date: Sun Nov 15 20:14:28 2009 +0000 [BUG] fatal() on nick change on gamesurge network Some time gamesurge sends a "foo NICK :foo" which we didn't handle correctly. commit 31ae5ac0bf2651778979fb974bba4e0fb6b4f0b8 (N) Author: Arnaud Cornet Date: Mon Aug 24 21:26:46 2009 +0200 [autostuff] Rewrite. Use non recursive make. Drop src/config.h.in that must be populated by autoheader commit 889f3cc1b7b4ed62f1d34c5afee6835ec30b72a6 (N) Author: Arnaud Cornet Date: Mon Aug 24 19:05:48 2009 +0200 Add -git to version string. commit c496bd702791b451d2bc248679405eaa0c9d9d41 (N) Author: Arnaud Cornet Date: Mon Aug 24 19:05:45 2009 +0200 Update src/version.h and Changelog for release. commit 70fbf99c7f6422a033220211307f6085a453edc3 (N) Author: Arnaud Cornet Date: Wed Aug 19 22:02:56 2009 +0200 Refactor _write_socket Call real_write_all in write_lines and write_line. This should fix debian bug #542291. BIG thanks to Zygo Blaxell. commit 7546daa27691fb981230c0119cd0e25a461ca770 (N) Author: Arnaud Cornet Date: Wed Aug 19 02:09:16 2009 +0200 [BUG] Handle badly lagging client conns decently. commit fa0c70539b5e2a86d08b635ff87979758d57da09 (N) Author: Arnaud Cornet Date: Sun Jul 26 11:38:20 2009 +0200 Allow parallel build (thks Whoopie and psychon). commit 442e4973cd6f67ef069b0d674d527033b68a57c2 (N) Author: Arnaud Cornet Date: Fri Jul 17 11:43:34 2009 +0200 Add -git to version string. commit a7c38c17c07d80fb740cd47098f75c93d76f7c1c (N) Author: Arnaud Cornet Date: Fri Jul 17 11:43:29 2009 +0200 Update src/version.h and Changelog for release. commit 213643d5bf74d1d71b8faec71505a4c1ec448452 (N) Author: Arnaud Cornet Date: Sun Jul 5 19:35:00 2009 +0200 size hour array correctly commit 1a2b1dd165282d24cc5c2a2e5f1bc4e793e41be5 (N) Author: Arnaud Cornet Date: Sun Jul 5 19:04:51 2009 +0200 Cleanup log outputs commit 36989553659370a8ed76d80932be485410095bbf (N) Author: Arnaud Cornet Date: Sun Jul 5 18:08:35 2009 +0200 Don't reset store->file_offset when adding a new file This just makes no sense commit a8fb0c40d3a0f26617bbbc5eea2381284d346f6b (N) Author: Arnaud Cornet Date: Sun Jul 5 14:00:06 2009 +0200 Support hour in log format. Mostly for debugging commit 32e08c94aaa192edafbe910901be79554a50e6ff (N) Author: Arnaud Cornet Date: Thu Jul 2 18:05:51 2009 +0200 SSL basic mode, support X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN commit 405f8b4afc33bac9fa8d7afffd526e9a02c81f0d (N) Author: Arnaud Cornet Date: Sun Jun 28 16:33:29 2009 +0200 [log] Use canonical name to detect need for log rotation Also reset store on part from server to close more file descriptor. commit 453223442660150c33c3f55b661d7ba93fab3802 (N) Author: Arnaud Cornet Date: Thu Jun 25 01:24:38 2009 +0200 [ssl:basic] Restore trust command behavior that was broken (repported by psychon) commit 5ae1c1dec53b22e4af4ca283d3d140862bec6ec7 (N) Author: Arnaud Cornet Date: Thu Jun 25 00:43:44 2009 +0200 [log] close logs files more intensively. commit 7af35a3018e3aff62411ad770d9fc14e344b526a (N) Author: Arnaud Cornet Date: Thu Jun 18 13:50:43 2009 +0200 Bad and useless strncat use (reported by psychon, thanks to him) commit 015969e86be1f15925856c0673b1dd3261b3b2fc (N) Author: Arnaud Cornet Date: Sat Jun 13 17:29:44 2009 +0200 [log] Fix to /bip backlog x This is fix for: When using /bip backlog X windows with no tracked backlog (ie after a blreset) do not show backlog commit 8cea2bdb710f40d7ed22acc14af5ead9179912aa (N) Author: Arnaud Cornet Date: Sun Jun 7 13:22:20 2009 +0200 Don't fail if ressetting non existing store. commit 94b5ac4797a10188f95cc7e8774cb2dfd6db6302 (N) Author: Arnaud Cornet Date: Fri Jun 5 00:44:28 2009 +0200 [release script] Fix mktemp usage commit 499a7d75b59e7bfdf3bfc9201015f7bc94e3135e (N) Author: Arnaud Cornet Date: Fri Jun 5 00:43:05 2009 +0200 backlog tweak commit 9187d556b54d04927b11c97aed18909059be6c43 (N) Author: Arnaud Cornet Date: Wed Mar 25 11:40:19 2009 +0100 Fix info user parsing. commit 3166a570223020f8b3c7bee8649f244e40d6978d (N) Author: Arnaud Cornet Date: Mon Mar 2 12:54:27 2009 +0100 Add -git to version string. commit 104d251a0bfe29e9a8a2edf67373b6cf2db11ddf (N) Author: Arnaud Cornet Date: Mon Mar 2 12:54:25 2009 +0100 Update src/version.h and Changelog for release. commit b6f30f6a032421911035f77a59d29549e4ab7828 (N) Author: Arnaud Cornet Date: Sat Feb 28 11:19:57 2009 +0100 Fix one leak. Fix git-release script for new git. commit 29ff342d93ba4f5c253702468c3c951a9e61eb91 (N) Author: Arnaud Cornet Date: Sun Feb 8 12:36:49 2009 +0100 Add option ignore_server_capab commit b8c740357d9aeaa0d74b53bacdd55156752d3c64 (N) Author: Arnaud Cornet Date: Mon Feb 2 19:51:10 2009 +0100 Add -git to version string. commit 1f462ef03585d3cf439e36a591dc3c4630d2d2a1 (N) Author: Arnaud Cornet Date: Mon Feb 2 19:51:05 2009 +0100 Update src/version.h and Changelog for release. commit eef2fd180d77aab96337a5a0ecd240cc2dea0328 (N) Author: Arnaud Cornet Date: Mon Feb 2 19:47:53 2009 +0100 [CLIENTHACK] Remove xchat's + and - on each msg This patch drops CAPAB setting in 005 message from server to client. Doing this xchat does not start the mode that prepends a + or a - at the beginning of PRIVMSGS. commit c4fb1b140add5050c8f4c1a77856272aac40cc01 (N) Author: Arnaud Cornet Date: Wed Jan 28 19:21:30 2009 +0100 Another man typo found by Renzokuken. commit b5d777dfee75cad37fe488634b68d2fd71689189 (N) Author: Arnaud Cornet Date: Wed Jan 28 15:13:44 2009 +0100 man typo found by Renzokuken. commit 69640eaf8c49339d71523d01fcb21494db546172 (N) Author: Arnaud Cornet Date: Tue Jan 27 11:24:50 2009 +0100 [FIX] Complete previous commit Previous commit was incomplete and did not log some weird messages. They still might be legit, so we come with them commit 5416fc19b203e94bb31cd35ef2ceeafb2ddbbd5f (N) Author: Arnaud Cornet Date: Tue Jan 27 08:25:44 2009 +0100 [FIX] check for weird shape notice messages Prevents a fatal on some rare conditions commit c2b3090e471b6f169b9359e5c8d89c6b5920e0d1 (N) Author: Arnaud Cornet Date: Mon Jan 26 16:57:52 2009 +0100 Cosmetic (special kasdedi a trou) commit bfc86202a1cfc3c0c7ed7252106f5ed4e1e265b7 (N) Author: Arnaud Cornet Date: Sun Jan 25 14:44:26 2009 +0100 Add -git to version string. commit 488a17dab5f29a19071edc798863a11507a1c893 (N) Author: Arnaud Cornet Date: Sun Jan 25 14:44:22 2009 +0100 Update src/version.h and Changelog for release. commit 5628da3ee07b7891c159469b0e8ac4080e91c8b5 (N) Author: Arnaud Cornet Date: Sun Jan 25 14:41:19 2009 +0100 Add warning when using 512 bits long moduli for diffie hellman commit b62c3e4697124e1331362f973296003fffc4b26f (N) Author: Arnaud Cornet Date: Sun Jan 25 14:24:22 2009 +0100 [SSL] Support ephemeral diffie hellman kex Pushing some non private data into openssl enables to use edh that provides perfect forward secrecy. commit 7e539298fdd5860e947debfa41c456efda0ba4aa (N) Author: Arnaud Cornet Date: Sat Jan 24 21:48:12 2009 +0100 Update NEWS file. commit 03210a796e45ec50709cca4528b98406e68f3fbe (N) Author: Arnaud Cornet Date: Thu Jan 22 12:06:26 2009 +0100 [CLEANUP] Add lots of asserts in utils list hash and array types are now even stricter on their usage. commit dae6cad3f7b0b6959ee8df2c9831c2c78e70162e (N) Author: Ben Byer Date: Thu Jan 22 11:26:03 2009 +0100 Add limit.h for INT_MAX commit 23b6ec4492dca350435069c170bffac8beb2ac65 (N) Author: Arnaud Cornet Date: Thu Jan 22 11:24:44 2009 +0100 Better check for backread returning NULL commit 43fe81e114e9fab747fc15a2e5683dc3d1d9f94b (N) Author: Ben Byer Date: Thu Jan 22 10:14:33 2009 +0100 add null pointer check to backlog_lines In some configuration backlog_lines can return NULL commit 170d4d1e00ebc16f898c093fbf094667058d7cd9 (N) Author: Arnaud Cornet Date: Wed Jan 21 17:24:54 2009 +0100 [FEATURE] autojoin_on_kick in connection blocks true by default commit afefc9a3d4590f488e3ffba3c9d016c0c335ef13 (N) Author: Arnaud Cornet Date: Tue Jan 20 19:30:20 2009 +0100 [FIX] Try to guess current daylight saving time When backloging we have no clue of a log lines dst, we try to guess it with current dst, which makes no sense, but at least it provides decent result when not near dst change. commit 500d5467069657c8258696d82cbc8a384ae0ddd8 (N) Author: Arnaud Cornet Date: Sun Jan 18 12:26:41 2009 +0100 [FIX] improper log rotation disconnection/reconnection log message bypassed the log rotation checks So if the message after a new day is a disconnected message, logs files did not rotate. commit 7a7c2432cf3fcffc8c78585d95c7c3a2d08e565d (N) Author: Arnaud Cornet Date: Sun Jan 18 11:26:08 2009 +0100 [FIX] make log_has_backlog actually work log_has_backlog used to check for the presnece of tracked logfiles to determine the presence of logs. This does not work anymore. This patch uses the last file tracker to determine that. commit 9882a0cbdc7c3235a9df211b04dc47e8d1bbb846 (N) Author: Arnaud Cornet Date: Sat Jan 17 15:03:06 2009 +0100 [CLEANUP] various cleanups commit fe251f72b5267f0223a0fe76910ffd215c34c40e (N) Author: Arnaud Cornet Date: Sat Jan 17 14:16:31 2009 +0100 [FEATURE] /quote bip backlog [n] /quote bip backlog triggers a log replay. With the optional argument n in hours, you can request a backlog of a few hours. commit 26eb9c28d7f81cbf6402117a9910ce430a2f29dc (N) Author: Arnaud Cornet Date: Sat Jan 17 12:50:39 2009 +0100 [OPTION] implement backlog_reset_connection backlog_reset_on_talk no works per query/channel. Setting backlog_reset_connection to true falls back to the former kind of backlog reset. commit 0e2f305d4edcee4c00b5c638681473ecd95062b2 (N) Author: Arnaud Cornet Date: Fri Jan 16 15:17:34 2009 +0100 [cleanup] Try to cleanup this pid mess close files, but no too soon... commit 2d9d388fba14659e5052a8658a1f36a257a84ad0 (N) Author: Arnaud Cornet Date: Fri Jan 16 15:09:53 2009 +0100 Close some fds, original path from Trou. commit 7565b9cb8ef708cb21bb4ce40f2378c750055853 (N) Author: Arnaud Cornet Date: Fri Jan 16 15:09:22 2009 +0100 typos commit 111f1382d1b1e160a1edf6a52c4b4d9f6415b529 (N) Author: Trou Date: Fri Jan 16 14:45:31 2009 +0100 Fix fd leak commit b912282410dd701abf353e7d197ef49b31bd55cf (N) Author: Arnaud Cornet Date: Fri Jan 16 12:30:24 2009 +0100 optionnal -> optional commit 3b704f53c4cbc849d0a83cf171393930280a9d76 (N) Author: Arnaud Cornet Date: Thu Jan 15 22:56:42 2009 +0100 drop unused variables commit be0d83d681b5ebce5b6d9fe53121e04ef6792227 (N) Author: Arnaud Cornet Date: Sat Jan 10 14:16:36 2009 +0100 Remove code inside #if 0... it's what svcs are for commit 8ed0565266040c53043e8a875d86d61bd6c09096 (N) Author: Arnaud Cornet Date: Sat Jan 10 14:08:41 2009 +0100 [LOG] Fixup log_beautify to work beautifully :) commit a5814b17a03902648acf66a958c6434dc792a104 (N) Author: Arnaud Cornet Date: Sat Jan 10 13:34:40 2009 +0100 Don't log queries with -bip, fix blreset help commit b3d7dbfb02f18f8858f0ce335191826013ce10a9 (N) Author: Arnaud Cornet Date: Sat Jan 10 13:26:59 2009 +0100 [COSMETIC] Avoid opening a query with your own nic This exception is cosmetic, but you want it. Most of the time, you get backlog from your own nick for your mode changes only. Hence opening a query just to say "end of backlog"... commit 744ea7d03b5adb4ea36f547d326cbd3262ed2ddf (N) Author: Arnaud Cornet Date: Sat Jan 10 12:55:13 2009 +0100 Merge branch 'master' into bip08 commit 67ddf152647e178d97359907782375d30586ca5f (N) Author: Arnaud Cornet Date: Sat Jan 10 12:53:25 2009 +0100 [BUG] channel with key handling A bug existed when a client issued join commands with multiple keys: JOIN #a,#b keya,keyb which this patch fixes commit f536a0546d113436bcc690708049ecb1a4aefeaf (N) Author: Arnaud Cornet Date: Sat Jan 10 12:35:59 2009 +0100 Cleanup and fixes of the backlog code commit 32cf2d462f54f06b59a1a5d635e01b5da0f4492a (N) Author: Arnaud Cornet Date: Fri Jan 9 13:24:11 2009 +0100 Backlogging code cleanup: fixes This makes the new backlogging code, actually backlog something. commit f1221703b06da28696b5f0e607f1f99abcf1c351 (N) Author: Arnaud Cornet Date: Fri Jan 9 11:26:12 2009 +0100 [FEATURE] reset backlog on talk now "window" local The reset_backlog_on_talk now resets current query or channel. The /bip blreset command not takes an optional argument taking query name or channel name. commit a6bb697f5da9016c65bf8dd39767d12a4422b6c3 (N) Author: Arnaud Cornet Date: Fri Jan 9 09:57:17 2009 +0100 Merge branch 'master' into bip08 Conflicts: src/log.c commit d2f7840ced065d644ba626413f5e53900efb39ef (N) Author: Arnaud Cornet Date: Thu Jan 8 11:01:47 2009 +0100 [BUG] Fix fatal on some nick change When a nick changes to one for which we already have a logstore allocated. We try to overwrite a hash entry that is already existing leading to a fatal. This pach cleans things up before rename the logstore. commit a57e76f883c8d7f138fb61eb2c8edc66413c7012 (N) Author: Arnaud Cornet Date: Tue Jan 6 16:34:17 2009 +0100 add fclose on pid file commit eb57d9683d95ea49868f984ad2c2cd93e85fc351 (N) Author: Arnaud Cornet Date: Tue Jan 6 16:28:06 2009 +0100 Drop some unused variable. commit 41c0a5a9c6d5d403445ad9bac18823bae9c49b10 (N) Author: Arnaud Cornet Date: Tue Jan 6 15:58:18 2009 +0100 Fix bip_notify usage These may lead to crash if you call in your conf networks or other names with %s or other fancy format strings. commit 06001961021beff6aca472b7456078651bad8f2e (N) Author: Arnaud Cornet Date: Mon Jan 5 23:24:49 2009 +0100 merge master commit 217816c220905365b323acee8c81a67917e26d08 (N) Author: Arnaud Cornet Date: Mon Jan 5 22:57:27 2009 +0100 And anothear nick_from_ircmask leak. commit 00a10a9f610cda3d186ac464ba6b485b52db94b2 (N) Author: Arnaud Cornet Date: Mon Jan 5 22:56:01 2009 +0100 Fix another leak. commit 96a91cd92e6aab1c04587e5c3a77bfefcb89adff (N) Author: Arnaud Cornet Date: Mon Jan 5 22:54:10 2009 +0100 Fix leak during backlog. commit aab5e61c050d28ae049d46d2a50781c4a2b6fd94 (N) Author: Arnaud Cornet Date: Mon Jan 5 22:52:25 2009 +0100 Fix leak. commit 2ef3506a22deb016055d66d2c036976028d948a1 (N) Author: Arnaud Cornet Date: Tue Dec 30 11:12:52 2008 +0100 Remove useless null check. Cycle server on early connection problem. commit 0ecb77617cedbf0b82c9f1ed78af61d47a6c3a32 (N) Author: Arnaud Cornet Date: Mon Dec 29 15:31:32 2008 +0100 Sanitize bip_(m|re)alloc size. commit b9f86d544d6422f61870f1326cf1197a959530fb (N) Author: Arnaud Cornet Date: Mon Dec 29 14:07:09 2008 +0100 Add autoheader in boostrap script. commit a4b101cea82654ab3eb028b794b8776238ddd82c (N) Author: Arnaud Cornet Date: Mon Dec 29 14:04:51 2008 +0100 ensure null terminated str commit 3f895fa6ea4632f4fb6e28d539410ad4b1123c46 (N) Author: Arnaud Cornet Date: Mon Dec 29 09:15:44 2008 +0100 Merge branch 'master' into bip08 commit 5a5f1b8bfbbdca16b141b776593721b4c2fdcf00 (N) Author: Arnaud Cornet Date: Mon Dec 29 09:15:27 2008 +0100 Some autoconf magic fix commit 8d7eecf78bb45b4205abd14923a3b3a3ce59b0e9 (N) Author: Arnaud Cornet Date: Mon Dec 29 09:14:24 2008 +0100 Fix fatal Element with key %s already in hash on client disconnect. bad hash usage commit b222196b18b6854963c625f874457aa520b3955b (N) Author: Arnaud Cornet Date: Sun Dec 28 15:47:43 2008 +0100 Use backtrace when --enable-debug=yes and avail. I KNOW AUTOCONF. commit c0db3c408dfb6ebbd01d481bf00e33eb0c26706e (N) Author: Arnaud Cornet Date: Sun Dec 28 14:47:44 2008 +0100 Merge fixups commit 24110a58dc0e5c38751ffdfd698360f45b5e65d2 (N) Author: Arnaud Cornet Date: Sun Dec 28 14:45:44 2008 +0100 Fix leak + cleanup list_append. Thanks to TheMIROn for spotting the leak. commit 3c810eef53be514d76109a94b7e35579585408e3 (N) Author: Arnaud Cornet Date: Fri Dec 26 18:43:35 2008 +0100 Refactor log system. prepare for /backlog 1 hour commit 8693044511a2129a3b24c9fd7c20f38972c971f3 (N) Author: Arnaud Cornet Date: Fri Dec 26 08:56:03 2008 +0100 fix notice logging file storage commit 20ce456e385cf843aca99e58c0f92af595151420 (N) Author: Arnaud Cornet Date: Thu Dec 25 18:34:36 2008 +0100 Work out autoconf magic Now --disable-ssl works as expected. The bug is there since bip uses autoconf. CHAMPAGNE. commit b102aed08a511e283aab1850fd955163d3758208 (N) Author: Arnaud Cornet Date: Thu Dec 25 17:49:48 2008 +0100 array_extract: fix braindeadness. commit 7c6cc20e90dc073763cab3550b6f921c98bcfb02 (N) Author: Arnaud Cornet Date: Sat Dec 20 21:15:04 2008 +0100 Use hash_it_key cause now hash items can be null. commit fa78df648265955586e3013940f41218a02a2434 (N) Author: Arnaud Cornet Date: Sat Dec 20 20:26:38 2008 +0100 Fixup file name allocation commit e8bb841e5f04c6dd4982919d3a515bbbe8f136a0 (N) Author: Arnaud Cornet Date: Sat Dec 20 17:59:16 2008 +0100 refactor nick management code - drop struct nick. - follow nick changes in a basic way. right now it does not work if one changes nick and somebody else takes the old unused nick. commit 4d231e8ddce7881321a77e4bd20d43cd278590df (N) Author: Arnaud Cornet Date: Sat Dec 20 14:28:18 2008 +0100 Inline most array methods commit d3ef106c4f717ab696a32c44c668368f3c18608d (N) Author: Arnaud Cornet Date: Sat Dec 20 14:20:50 2008 +0100 New array type, cleanupts and rename logfilegroup log_store commit 4b723ca4798a2a60e84bbd2d92f68d1cfa2c8a66 (N) Author: Arnaud Cornet Date: Thu Dec 18 14:27:16 2008 +0100 more cleanups, start of a log refactoring That changes log format and might breack everything. commit fd644b312bb0b2d1b9689ce9de88fe81dcc4f33c (N) Author: Arnaud Cornet Date: Mon Dec 15 20:02:56 2008 +0100 bip_strdup fatals on out of memory commit c1501510662acec2ddc5f316546cef4f6e0d043f (N) Author: Arnaud Cornet Date: Mon Dec 15 19:19:27 2008 +0100 BIG cleanup. check for memory allocation failure, add extra checks all arround. commit e18d335578b63f888c9d9fec178c39f8f40c8b2f (N) Author: Arnaud Cornet Date: Thu Dec 11 11:00:05 2008 +0100 calloc/realloc checks. commit 2b96805ecb40862ff2c6927a72da20327f008ab2 (N) Author: Arnaud Cornet Date: Wed Dec 10 23:27:53 2008 +0100 Revert "drop fork priviledges when running." This reverts commit 1cbb1b9b7aa228704db91b942b6105e848a4eed0. It juste does not work, since this limit is uid-wide (thanks julien`) commit 3ab27557679d766571ba5cacb9012dca60b60fcc (N) Author: Arnaud Cornet Date: Wed Dec 10 23:26:37 2008 +0100 Catch malloc returning NULL. commit c3bb6639b68529ba34a8e6def5dbcb086b41e682 (N) Author: Vladislav Grishenko Date: Sun Nov 23 15:12:32 2008 +0100 Send after join /names before backlog there're some irc client which create windows, session etc only on 366 packet received (End of /NAMES list) like Miranda IM, QIP that's why backlog sent from bip after 332/333 packets and just before 353/336 goes to nowhere i'v took a look at other irc bouncers, all of them send backlog right after 353 /336 packets so, all what we need is just chamge the order in static void irc_send_join(struct link_client *ic, struct channel *chan) commit 0f0d0427b8303414a7058cfe8f867837118c17f0 (N) Author: Arnaud Cornet Date: Sun Nov 23 15:09:24 2008 +0100 Enlarge connection buffer size and logline_maxlen. commit c21db5a556df2e1b647a32b811fe1db73cbc4982 (N) Author: theMIROn Date: Tue Nov 11 16:07:42 2008 +0100 Fix for empty topic creator and timestamp on RusNet IRC Servers commit 383a3a4477387392d50e245b049cf0c5e0490505 (N) Author: Arnaud Cornet Date: Sun Nov 9 19:05:49 2008 +0100 Fix help message: bip reload is quite stable for some time now. commit 1cbb1b9b7aa228704db91b942b6105e848a4eed0 (N) Author: Arnaud Cornet Date: Fri Oct 31 19:38:12 2008 +0100 drop fork priviledges when running. commit e8c6adedc9d782ef35968cc7b68c21c5fbb3f7c6 (N) Author: Arnaud Cornet Date: Fri Oct 24 10:24:52 2008 +0200 Add -git to version string. commit fcfea9921a55455bba7ad5f0e616170e228b885a (N) Author: Arnaud Cornet Date: Fri Oct 24 10:24:49 2008 +0200 Update src/version.h and Changelog for release. commit cd82512f7a5f2d708c87e486cbf48ed2d933287b (N) Author: Arnaud Cornet Date: Fri Oct 24 09:11:23 2008 +0200 Ignore nick channel status in whorepl. Fix crash on client empty privmsg. commit f6582a54b294d6fb1f68e6e732aff3b8702e70df (N) Author: Arnaud Cornet Date: Fri Oct 24 00:08:47 2008 +0200 bipgenconfig: generate 4096 bit rsa keys commit 83b19b7c5a002a64259441f4dc4af743b560eafd (N) Author: Arnaud Cornet Date: Wed Oct 8 01:04:14 2008 +0200 Hack around to make halfop support actually work. commit ed92b9a8bdc19587549de8d480d47a25511bddb4 (N) Author: Arnaud Cornet Date: Wed Oct 8 00:05:26 2008 +0200 Build fix commit 8ba984165b0fd464a9730c41e975f3b24f1da187 (N) Author: Arnaud Cornet Date: Sat Sep 20 14:48:16 2008 +0200 Implement quick halfop tracking support. commit ddacb833dd99df287853db3c97c71c17c491182b (N) Author: Arnaud Cornet Date: Sat Jun 28 18:59:19 2008 +0200 Add -git to version string. commit 412cddaf519e78dba62afac3ecc28a0b85011ce8 (N) Author: Arnaud Cornet Date: Sat Jun 28 18:59:15 2008 +0200 Update src/version.h and Changelog for release. commit babaac246d9d05a0c555823be16e8827561b2da8 (N) Author: Sebastian Hagen Date: Tue Jun 24 20:27:12 2008 +0200 Do not freak out when seeing unreal ircd wierd name flags. commit 81239265b9732177bfa2de785399528e5c79317a (N) Author: Arnaud Cornet Date: Sun Jun 1 11:11:30 2008 +0200 Add -git to version string. commit 1fb6c2a164f7aeeb556015b68dfc80357b6723b2 (N) Author: Arnaud Cornet Date: Sun Jun 1 11:11:28 2008 +0200 Update src/version.h and Changelog for release. commit 9ab6e6e125ba33aba50b261a2dc09ebf58c6db9c (N) Author: Arnaud Cornet Date: Sun Jun 1 11:11:08 2008 +0200 Update src/version.h and Changelog for release. commit 35e581244813c7db42c0267f0189c270a24c0577 (N) Author: Arnaud Cornet Date: Sun Jun 1 11:11:03 2008 +0200 Make jj's patch build commit e863227099e4fdd60bf5c6a87e2a274d4c89d683 (N) Author: Arnaud Cornet Date: Sun Jun 1 11:05:22 2008 +0200 Fix probable but rare memory leak commit 3f9d1621293176ca489c341ccde154eff8c28437 (N) Author: Arnaud Cornet Date: Sun Jun 1 10:56:16 2008 +0200 Add -git to version string. commit 9fcbe8a6aa9ef113b721c97139f1e1d6af91a64c (N) Author: Arnaud Cornet Date: Sun Jun 1 10:56:12 2008 +0200 Update src/version.h and Changelog for release. commit fc546e9db8ddf63b92d9cab5743148fb787d0953 (N) Author: Arnaud Cornet Date: Sun Jun 1 10:27:52 2008 +0200 Support channel modes q and I (oftc) commit 604eb26ec6fa46b7840d03208da1bb8a1f78a727 (N) Author: Arnaud Cornet Date: Sat May 31 12:31:30 2008 +0200 Merge jj's patch (debian bug 481488) commit d92ffeea09a7a725ec16e15735f4b18670878187 (N) Author: Arnaud Cornet Date: Sat May 31 12:24:56 2008 +0200 Update todo commit 4b2a0eb935101e353d9d510f4a53da77c04c67bd (N) Author: Arnaud Cornet Date: Sat Apr 5 11:55:42 2008 +0200 Add -git to version string. commit 39d2850ad722d5df4f4d42206b1d757bde690c84 (N) Author: Arnaud Cornet Date: Sat Apr 5 11:55:40 2008 +0200 Update src/version.h and Changelog for release. commit dbcd0aad07cf3f0ccdd2b59d827535e80d99c1e2 (N) Author: Arnaud Cornet Date: Sat Apr 5 11:44:15 2008 +0200 Fix build on systems without RLIMIT_AS (eg OpenBSD). commit f618d05af831cc7691b15a997dcfada0dd30a4cb (N) Author: Arnaud Cornet Date: Wed Apr 2 23:56:21 2008 +0200 Merge bip.conf.5 fix from debian. commit 82dbe852f8833a875b0509d1532e4f8c9fb2725b (N) Author: Arnaud Cornet Date: Wed Apr 2 23:49:51 2008 +0200 Add -git to version string. commit 37a44139d11dc48691bdd7ce1ea424c94fc241af (N) Author: Arnaud Cornet Date: Wed Apr 2 23:49:48 2008 +0200 Update src/version.h and Changelog for release. commit 2cbf377cc2ce387ed2542a0c2c7a2b45c38ba58d (N) Author: Arnaud Cornet Date: Wed Apr 2 23:41:27 2008 +0200 Fix default nick/user/realname check (debian bug 473999). allow ssl_check_mode = none. tweak HOME handling. Most of this is Yoann Guillot's work. commit e383c2b6f6c69bf71010621b5e9f2be875b92971 (N) Author: Loïc Gomez Date: Sat Feb 16 13:50:40 2008 +0100 Merge branch 'master' of http://bip.t1r.net/bip commit 6cee8c728f4465e2cb185d2e32e1d6587c063a41 (N) Author: Arnaud Cornet Date: Sat Feb 16 11:33:00 2008 +0100 bip-release glitch fix. commit 303503cfc75634b891664afa00ccdad290e464bc (N) Author: Arnaud Cornet Date: Sat Feb 16 11:32:13 2008 +0100 Post release leak fix. :) commit 2516a89ac873cc04dc2403b9b3400a5125cc6828 (N) Author: Arnaud Cornet Date: Fri Feb 15 23:59:35 2008 +0100 Add -git to version string. commit eb1dbb1023ca4d5c207936e1e7f39aa323eebe2c (N) Author: Arnaud Cornet Date: Fri Feb 15 23:59:30 2008 +0100 Update src/version.h and Changelog for release. commit d7430d44cc780384507bef5bb3f1a4c3e1cc6315 (N) Author: Loïc Gomez Date: Mon Feb 11 13:10:42 2008 +0100 SSL: - make bip compile with --disable-ssl configuration commit ba4e70d6647cab63471391649adc7d5029d43228 (N) Author: Loïc Gomez Date: Mon Feb 4 18:38:09 2008 +0100 fix unwanted commit commit efe0c43b9cdd3c0a4d1183678b36e2c33d7383fa (N) Author: Loïc Gomez Date: Mon Feb 4 18:36:35 2008 +0100 Documentation fixes - update bip.vim and bip.conf sample files - remove nonsense LOG_STD log level commit 89e88f6b7ba73eabe11d1dfae11131a9095248c2 (N) Author: Loïc Gomez Date: Mon Feb 4 18:07:27 2008 +0100 /BIP commands: - fix "(admin)" info inverted in /BIP list users commit fd5e483a499d8b4986128e9be7bcb70cc8315c8a (N) Author: Arnaud Cornet Date: Sun Feb 3 11:55:24 2008 +0100 Warn only when open files limit is smaller that 256. commit b024221cecb8f61e00c251f9785e84852169667b (N) Author: Arnaud Cornet Date: Sat Feb 2 12:46:20 2008 +0100 Use const varibable more consistently. commit d5ef114c2e71e444cf698b56052e066e409f57b5 (N) Author: Arnaud Cornet Date: Tue Jan 22 00:36:18 2008 +0100 Have autodirt install manpages. commit 7470ebe96eb381e660508a32b81beba4f20e10f5 (N) Author: Arnaud Cornet Date: Mon Jan 21 22:21:09 2008 +0100 Move bip.conf man page to section 5 (Fix debian bug 461871). commit 055266f92decb1c7155748f9dfd230fa63172be7 (N) Author: Arnaud Cornet Date: Sun Jan 20 18:51:04 2008 +0100 Add -git to version string. commit f8c2876633167e36340cfe1304f2cd412168fc18 (N) Author: Arnaud Cornet Date: Sun Jan 20 18:51:01 2008 +0100 Update src/version.h and Changelog for release. commit f1cc6451f5d1815d2865567cd841ac06fd32be5a (N) Author: Arnaud Cornet Date: Sun Jan 20 18:49:44 2008 +0100 Handle SSL-client auth. Fix crash on del_conn when the link never got connected at all. commit c90578103cdc158c709d5e11f17a8fca5e7650ae (N) Author: Loïc Gomez Date: Thu Jan 10 11:33:00 2008 +0100 README: - add a "session limit exceeded" / oidentd section commit 06cfc9160bff7e246564817df0f0dc1061a280b6 (N) Author: Loïc Gomez Date: Thu Jan 10 11:11:49 2008 +0100 Merge branch 'master' of http://bip.t1r.net/bip commit 78cb1c44c48c9fccfc4dacb6d35eece622f45be5 (N) Author: Arnaud Cornet Date: Wed Jan 9 23:47:19 2008 +0100 Cleanup BUGS and TODO. commit 671a4552193b1b1cc463e85ab044e6851e9c20a1 (N) Author: Loïc Gomez Date: Wed Jan 9 23:45:40 2008 +0100 Fix UTF-8 in all files commit 1ea9f515397c18fcb50744bc66bc22bf2706282e (N) Author: Arnaud Cornet Date: Wed Jan 9 23:31:22 2008 +0100 Fixup for release script. commit 7aae8ed1806f7a811609f8d96af4778e5524190a (N) Author: Arnaud Cornet Date: Wed Jan 9 20:32:35 2008 +0100 ctcp version reply cosmetics. commit 60e50d56c6bd15bb87f17de908970d5e92b1a679 (N) Author: Arnaud Cornet Date: Wed Jan 9 20:18:48 2008 +0100 Add -git to version string. commit 985c75a38b79bc891435b5dc25963f7a5bfc822f (N) Author: Arnaud Cornet Date: Wed Jan 9 20:18:27 2008 +0100 Update src/version.h for release. commit 8827476701e124f1b329b7211da43a3e588ce707 (N) Author: Arnaud Cornet Date: Wed Jan 9 20:17:38 2008 +0100 Turn bip-take-snapshot to a bip-release script. commit b9b491725e683738a9ae5d48f50c5494cd57576a (N) Author: Arnaud Cornet Date: Tue Jan 8 23:47:26 2008 +0100 Don't close not opened file. commit 9f9a2e085662f3bc559b06a82f31d557f4b3e21e (N) Author: Loïc Gomez Date: Tue Jan 8 10:50:55 2008 +0100 Documentation : - README.floodcontrol is in README now commit 7ba4297a92e95af4ab61386bc889107678ec1e94 (N) Author: Loïc Gomez Date: Tue Jan 8 10:50:31 2008 +0100 Documentation : - fix typos - include README.floodcontrol into README commit eb32b16872d84103bede36a450eba2e31a6e713d (N) Author: Loïc Gomez Date: Tue Jan 8 10:31:22 2008 +0100 SSL options: - fixes - PEM file world readable is a non fatal error commit 8c0ce5efd3a32200f54696ce84f461a6cd4192ef (N) Author: Loïc Gomez Date: Tue Jan 8 00:24:53 2008 +0100 SSL: - check PEM, last version... commit 517cda49466b85d2e61b1462b06b04a328949983 (N) Author: Loïc Gomez Date: Tue Jan 8 00:09:16 2008 +0100 SSL: - fix checking of PEM file commit c10061172c34bb6c6b8b4e5febbe39a14595b342 (N) Author: Loïc Gomez Date: Mon Jan 7 23:46:31 2008 +0100 Merge branch 'master' of http://bip.t1r.net/bip commit 4d97f4ebcdc80718a54adbb5aecc4d9fa21b8aac (N) Author: Loïc Gomez Date: Mon Jan 7 23:46:29 2008 +0100 SSL: check for client_side_ssl_pem file to be present commit d007a14baa114fc1a532bba98ba85d647d98a55a (N) Author: Arnaud Cornet Date: Mon Jan 7 23:43:37 2008 +0100 Bail on config errro on startup. commit 1a8b06ab30f0b7ddb7920848ecac7834c7b472e6 (N) Author: Arnaud Cornet Date: Mon Jan 7 23:32:34 2008 +0100 Update Changelog and NEWS. commit 47807cd2b3a062e77223e5829466b262edf94099 (N) Author: Loïc Gomez Date: Mon Jan 7 22:57:11 2008 +0100 bipgenconfig: - detect bipmkpw path when possible commit f8e377c2b6662c1eafaf9e2dd10bebf153628097 (N) Author: Arnaud Cornet Date: Mon Jan 7 22:53:40 2008 +0100 README typo fixes. commit 74ef2e746018ae621d68d51cc5a7b24d0953cafd (N) Author: Arnaud Cornet Date: Mon Jan 7 22:31:28 2008 +0100 Cosmetic fix for man page. commit ca785fd28020d640a03a8f8f2f13191dea05c2e6 (N) Author: Arnaud Cornet Date: Mon Jan 7 22:21:55 2008 +0100 Merge commit 'kyo/pemfile_option' commit 36d31e32e516f3b0ebb637b6580b5bbfce52833e (N) Author: Loïc Gomez Date: Mon Jan 7 20:42:40 2008 +0100 rename client_side_ssl_key to client_side_ssl_pem commit d02957f8bb3bca87747880b659bd098c5f604491 (N) Author: Loïc Gomez Date: Mon Jan 7 20:39:13 2008 +0100 Merge branch 'master' into pemfile_option commit 2cd37c0e13d4d500e7e989b46277810c544ab588 (N) Author: Loïc Gomez Date: Mon Jan 7 20:38:57 2008 +0100 fill readme with more information commit d3a4ee6bcbcab4f14181a14f44bdca5cb76644e1 (N) Author: Loïc Gomez Date: Mon Jan 7 19:48:04 2008 +0100 forgot the manpage.. commit 87ef072bb9a56311296f3afe0ad3702a88d5a030 (N) Author: Arnaud Cornet Date: Mon Jan 7 19:36:38 2008 +0100 Merge commit 'kyo/pemfile_option' commit da442e0be70bdd66a99b54d4383cfbf8d852637e (N) Author: Loïc Gomez Date: Mon Jan 7 15:54:51 2008 +0100 bipgenconfig client_side_ssl_key option commit 2034713356184d6921bdf33e50cac796f5ffe2c3 (N) Author: Loïc Gomez Date: Mon Jan 7 15:50:25 2008 +0100 Merge branch 'master' into pemfile_option commit 8eda1ace0e350231ae623ea990364ebfb55b0f4c (N) Author: Loïc Gomez Date: Mon Jan 7 15:22:28 2008 +0100 bipgenconfig script : - add missing options - generate options before sub-blocks (for example in user block) - fix loadConfig not loading networks and users as arrays - add compatibility process to rename old options to their new names when loading config from bipgenconfig store commit e7e49fdad1a2d6929fc02ff177b5e0c9bee9c612 (N) Author: Loïc Gomez Date: Mon Jan 7 14:27:37 2008 +0100 SSL configuration: - warn when bip is not SSL-capable and configuration contain SSL options - add a client_side_ssl_key option to define the path to bip.pem file commit 8b272bb0fdb1b1578094a1317c552b848684b4d8 (N) Author: Loïc Gomez Date: Mon Jan 7 14:00:25 2008 +0100 fix misleading fatal() message (pidfile error) commit 56b73ad73af0b24ff6980c35166d44d77dbd6b12 (N) Author: Loïc Gomez Date: Mon Jan 7 13:47:12 2008 +0100 Merge branch 'master' of http://bip.t1r.net/bip Conflicts: bip.conf.1 commit 20129da225d1355cb08fbb929280921893b73795 (N) Author: Arnaud Cornet Date: Sun Jan 6 00:25:56 2008 +0100 Realloc correct size when receiving admin privmsg. commit c5d1f537e40706cdfdd5a8ff23de9b3e337153a8 (N) Author: Arnaud Cornet Date: Sat Jan 5 23:25:24 2008 +0100 Null deref fixes when fetching info. commit f96751cfb9e1a1b08ac0a0b95b4715f2bb7c629b (N) Author: Arnaud Cornet Date: Sat Jan 5 23:11:41 2008 +0100 We are in 2008, and strncasecmp -> strcasecmp when cmp'ing with constants. commit b095e53efbd052cfd876a7c302c09c52f6dfac5c (N) Author: Arnaud Cornet Date: Sat Jan 5 23:04:07 2008 +0100 Fix adm privmsg parsing. commit a7e5ca3d0b2495b4ff044037592a8fb550d9fca7 (N) Author: Arnaud Cornet Date: Tue Jan 1 21:24:04 2008 +0100 Have a sane ctcp version code. commit eb829819965806365ecfa111d4d1102781bfb923 (N) Author: Arnaud Cornet Date: Tue Jan 1 15:02:45 2008 +0100 Allow weirdly ordered user blocks in config. commit 781b1ba8d063d8ba54a2c23e6d8bc85d4dd1e232 (N) Author: Arnaud Cornet Date: Tue Jan 1 13:59:48 2008 +0100 Fix README (thanks to Brian Evans). commit f7d07bc5fa207ce4305ee632debbcae1065ce133 (N) Author: Arnaud Cornet Date: Tue Jan 1 13:55:47 2008 +0100 Bail on invalid confs. commit 3eab14cfb95d9ecee76fd67d7df528b1617e0e3e (N) Author: Arnaud Cornet Date: Tue Jan 1 13:33:21 2008 +0100 Have the arrow bold to highlight your own words in remote clients. commit 8b8024b81ecce0ce43422aa6eda3f8f49f0ea21f (N) Author: Arnaud Cornet Date: Sat Dec 29 18:17:50 2007 +0100 Make it even build. commit 95618a06ab001179e107f535aa48193ddab38132 (N) Author: Arnaud Cornet Date: Sat Dec 29 18:15:03 2007 +0100 Fix stuuuuuupid leak in hash_clean. commit b020e895a84bc3a1649b8f8a43f034e3e27604c7 (N) Author: Loïc Gomez Date: Sat Dec 29 01:35:11 2007 +0100 Add subcategory in help commands. commit ac407d9a3deae111dd00cacd298e70d1b8780b33 (N) Author: Loïc Gomez Date: Sun Dec 23 21:17:57 2007 +0100 Merge branch 'master' of http://bip.t1r.net/bip commit e0170c8144b0ff0321004bd40e6f26674c372945 (N) Author: Arnaud Cornet Date: Fri Dec 21 12:54:06 2007 +0100 This makes no sense. commit 64b34683937de4a81bbfbfcf6f689490945538b3 (N) Author: Arnaud Cornet Date: Fri Dec 21 12:45:49 2007 +0100 Fix misplaced free. commit 8d25dfea51149762959d5df834b04740a666ed4b (N) Author: Arnaud Cornet Date: Fri Dec 21 12:27:44 2007 +0100 Clear newly allocated connection structs. commit e6efc4b1c5c9f7b42047d5c4b89c6e85f340d3ca (N) Author: Arnaud Cornet Date: Fri Dec 21 12:21:23 2007 +0100 Fix just introduced leak. commit 27b16a86b8fed92e2e5bba4ed44a921a696ac532 (N) Author: Arnaud Cornet Date: Fri Dec 21 12:20:21 2007 +0100 Avoid unncessary calls to getaddrinfo. Refactor calls to getaddrinfo only on socket establishement, cache in connection structure. commit 130d649e0b53c4bb77cf4320afd4a12b61441c2a (N) Author: Loïc Gomez Date: Sun Dec 16 17:28:01 2007 +0100 Fix misleading text in manpage commit 8f998c97b6413a2982af0b7a4e4bf08a8f993d59 (N) Author: Arnaud Cornet Date: Fri Dec 14 23:07:18 2007 +0100 Be verbose when conf_die is called. Try to inform calling client. commit cbcd4c18a3fb3bf32f884954843185f4761f3543 (N) Author: Arnaud Cornet Date: Fri Dec 14 22:06:20 2007 +0100 Fix fatal() on /bip jump. commit 7c3fc4bc2763701c13f15a36f344855502a1b003 (N) Author: Arnaud Cornet Date: Tue Dec 11 00:23:49 2007 +0100 Fix ctcp reply so it has a chance to work commit 73c4a8f1f13d0633fd3486d546f73551593f37d9 (N) Author: Arnaud Cornet Date: Sun Dec 9 14:23:00 2007 +0100 Fix bad error message when log_format does not contain %u commit 91fa881f948e727712d04eb93498a7a291f6dd63 (N) Author: Arnaud Cornet Date: Sun Dec 9 14:10:33 2007 +0100 Update news file. commit 5f562e74321e287e302c1170e9043aada9a4eff2 (N) Author: Arnaud Cornet Date: Sat Dec 8 16:22:56 2007 +0100 Annoying bip-take-snapshot fix commit e1fb3e42ff539bae7142b03779543fef82fb79d9 (N) Author: Arnaud Cornet Date: Sat Dec 8 16:12:05 2007 +0100 Fix backloging error when one character message. commit 1a9a72432baae4700997026eb958c1b71935d895 (N) Author: Arnaud Cornet Date: Sat Dec 8 16:00:50 2007 +0100 Fix double arrow prefix for self issued private messages when more that two clients are connected. commit 95586c79e3791bd01379d50968d39f2a8add1e49 (N) Author: Arnaud Cornet Date: Mon Nov 26 22:58:10 2007 +0100 init ci->backlog properly commit d92525b7a342d393eb012096e84453bf7914c1f2 (N) Author: Arnaud Cornet Date: Mon Nov 26 19:57:12 2007 +0100 Add ctcp reply. Fix badly initied chan_info commit 731a39f0d281ed38798b6358b442397d8a31fc5f (N) Author: Arnaud Cornet Date: Sun Nov 25 23:44:14 2007 +0100 Respond to CTCP VERSION. commit 8c649b4357dddf241cd3caa224e099eba5901e1f (N) Author: Arnaud Cornet Date: Sun Nov 25 18:37:13 2007 +0100 Big grammar round-up :) commit 7020e7fa4c3cd59bbe8e50ce14dea11b75aa21b0 (N) Author: Arnaud Cornet Date: Sun Nov 25 18:35:53 2007 +0100 snprintf fixups. commit 05e0f84af8c275371f63745aee6aab5a83aefe06 (N) Author: Loïc Gomez Date: Sun Nov 25 16:34:52 2007 +0100 bip_use_notice option commit b68b0dc71d802805b0c2ef7d0da729f574089d2a (N) Author: Loïc Gomez Date: Sun Nov 25 16:12:36 2007 +0100 Merge branch 'master' of http://bip.t1r.net/bip Conflicts: src/bip.c commit c064fe6472c5acc0b883516616029723ec9a488f (N) Author: Arnaud Cornet Date: Sun Nov 25 16:07:53 2007 +0100 notify when addconn command is successful. commit a65ffa67fa72a842a49a412f9c0bf598aa6367a2 (N) Author: Loïc Gomez Date: Sun Nov 25 16:06:45 2007 +0100 Merge branch 'bip_use_notice' Conflicts: src/bip.c commit 32cdb53d09f2c8028ffe4d438ae45c5c4f3579ce (N) Author: Arnaud Cornet Date: Sun Nov 25 15:50:19 2007 +0100 Add bip-take-snapshot commit 5faa6581b769aa747a85b5828e34a2fc893f4079 (N) Author: Arnaud Cornet Date: Sun Nov 25 15:39:38 2007 +0100 make log_has_backlog aware of track_backlog. commit 546f86b59287d91ecfed79751b824227e77edf1b (N) Author: Arnaud Cornet Date: Sun Nov 25 15:37:26 2007 +0100 Fix help message. commit b3b6df53bb47d9626dd62f69dd4cca206124615a (N) Author: Arnaud Cornet Date: Sun Nov 25 15:29:32 2007 +0100 Add track_backlog member in lfg, so we have a cleaner way to exempt a channel from backloggin. commit cc9afd6b1e03cf849122d10ba661f0cbec4d4c57 (N) Author: Arnaud Cornet Date: Sun Nov 25 14:50:22 2007 +0100 Support live addition and removal of connection. commit f1a0aede23539db2c9e527f58e4da220301d2525 (N) Author: Arnaud Cornet Date: Mon Nov 19 23:02:25 2007 +0100 typo. commit b33e832d2d9f697bdb0f020ffc6470348097147c (N) Author: Arnaud Cornet Date: Sun Nov 18 14:57:00 2007 +0100 add -q option to blreset. commit 51f5a9166427306f37e36406090d69bd39790d10 (N) Author: Arnaud Cornet Date: Sun Nov 18 11:08:41 2007 +0100 Cleanups. commit a21488ead62944c75e6b8353b05073a92f19fe11 (N) Author: Arnaud Cornet Date: Thu Nov 15 23:29:10 2007 +0100 nick collision recover fix. commit d96543f1db2973f9005683501d6057348c744b5f (N) Author: Arnaud Cornet Date: Thu Nov 15 22:50:51 2007 +0100 Fix double free at init time. commit 0876e783f37f8cc0e54fbd2b1011712940320f8d (N) Author: Loïc Gomez Date: Wed Nov 14 22:03:58 2007 +0100 is_valid_nick fix. small validate_config fix commit ec68655ccd15491ed9658a0cd4758e60adfca335 (N) Author: Arnaud Cornet Date: Sun Nov 11 07:37:19 2007 +0100 Handle deprecated directives... commit 1e449da922a292a098e2ffc3d25703e8e73b8fce (N) Author: Arnaud Cornet Date: Mon Oct 29 00:38:42 2007 +0100 Make SSL "basic" certificate check more loose (more SSH-like). In "basic" mode, normally un trusted certificates get to be trusted if they are manually trusted by user. This provides an SSH like private key auth mechanism. Expired certificates were considered invalid in this mode which does not make much sense. commit 6a0ced8929bb54265e6cd54b14d4d3397b680de0 (N) Author: Arnaud Cornet Date: Mon Oct 29 00:24:48 2007 +0100 Describe basic ca mode in bip.conf.1 commit addfac8ffa37edd0e743bc0ff2828e07550d48e6 (N) Author: Arnaud Cornet Date: Wed Oct 24 20:31:06 2007 +0200 Allow building with SSL. commit e5d45e7e64db89740bacf20291c3d1720efc4e52 (N) Author: Arnaud Cornet Date: Tue Oct 23 00:46:00 2007 +0200 Fix initialisation time bug found by Trou. commit 664ebb68a7b9822fbd74e0207337f451cb578e82 (N) Author: Arnaud Cornet Date: Sun Oct 21 19:35:22 2007 +0200 Destroy unused link after sighup commit 0abd8a386dac44b08a9dc0b1c4acf5744936e15b (N) Author: Arnaud Cornet Date: Sun Oct 21 12:31:07 2007 +0200 Config load fixes. - Leaks - Better logging - Handle historical configs commit 32e47b900ca0c0a0badf919f304a59ca89d66d0e (N) Author: Arnaud Cornet Date: Sat Oct 20 23:12:22 2007 +0200 Fixes to get the /BIP RELOAD command to at least work in a quick test. - reuse existing channel infos - dont clear conn_list on end of irc_main and don't add the listener if conn_list is not empty at start of irc_main commit 0a689b19f8d3bd6c90e1a04a62302bae672e5e12 (N) Author: Arnaud Cornet Date: Sat Oct 20 22:57:09 2007 +0200 Don't forget to free the buffer... commit b026214142f954efb1ab2f772a6963547e0bef78 (N) Author: Arnaud Cornet Date: Sat Oct 20 21:26:21 2007 +0200 Various fixes - Fix log redirrect to stderr when not going into background. - Fix connection_close to handle connections on error. - Handle servers you can't connect to the same way as servers that get disconnected. (wrt to reconnection timers) - Fix some log message commit 38148bbdc5c67b8e31975ca4677cbf2100c59f6c (N) Author: Arnaud Cornet Date: Sat Oct 6 15:43:38 2007 +0200 Make the thing build without HAVE_SSL commit dbe633ec5930885c5c8b5c6e0676154653c3fed4 (N) Author: Arnaud Cornet Date: Sat Oct 6 15:40:56 2007 +0200 Fixes for kyo's merge. A few rare snprintf bugs. Mostly cosmetic and cleanness stuff. commit a169ceb693b92d975382a859ac693544158eedc9 (N) Author: Loïc Gomez Date: Fri Sep 28 18:18:31 2007 +0200 BIP commands: - fix bug: ON_CONNECT_SEND can be multiword - add unified header/footer to each command reply commit 572f0a74f83ef7a430056efe7f622efab2479a86 (N) Author: Loïc Gomez Date: Fri Sep 28 17:52:41 2007 +0200 fixes: - add old TODO - fix adm_print_connection, channels with backlog wrongly printed with "key" flag commit dab337dfb832aaec703e87eca51be78980624861 (N) Author: Loïc Gomez Date: Fri Sep 28 13:21:05 2007 +0200 fix order in bip.conf.1 commit d3a5c40a40eeccd8958a6a8c9af48e82f023735a (N) Author: Loïc Gomez Date: Fri Sep 28 13:20:32 2007 +0200 bip_use_notice option + fix add bip_use_notice option to user-level configuration. fix typo in bip_notify() commit 72b028221d6e04c6756ef4f571668cb35a596e83 (N) Author: Loïc Gomez Date: Fri Sep 28 10:43:34 2007 +0200 adm_reply -> bip_notify commit dd49be1755ae6bd735065c7c983d19ca36f11a56 (N) Author: Loïc Gomez Date: Thu Sep 27 14:44:25 2007 +0200 define some defaults commit 12ea45b13242122708d1ed3032e28005c1a6f26a (N) Author: Loïc Gomez Date: Thu Sep 27 14:12:27 2007 +0200 cleanup change some log levels remove ssl_check_store from connection indent fixes check_rlimits: change explain text Git-explicit version commit 2090349f9c9f1732fa5348faf9f506fae892f916 (N) Author: Loïc Gomez Date: Thu Sep 27 01:08:10 2007 +0200 add backlog option to channels. commit 45e9688c45d2d66a599860a6eea46ca791b8157c (N) Author: Loïc Gomez Date: Wed Sep 26 22:21:01 2007 +0200 changelog commit e5ed7c92ae8d7db46e288dc9570448da5199ec49 (N) Author: Loïc Gomez Date: Wed Sep 26 22:18:50 2007 +0200 add ssl_check_mode option to the connection block (requested by Trou) die if ssl_check_mode is unset while the network needs SSL. commit 96693716fb1415a2afd0c0fb80716ad4fd335d90 (N) Author: Loïc Gomez Date: Wed Sep 26 22:08:59 2007 +0200 fix SSL commit 5aec7804afd049530af4438c90d88df053326220 (N) Author: Loïc Gomez Date: Wed Sep 26 21:22:44 2007 +0200 src/log: fix backlogging again, memlog was distrubing the process src/connection: change some log levels, errors are errors, not debug info... commit 6ab2bb51466d20b436d2105ff09a28480e97076b (N) Author: Loïc Gomez Date: Wed Sep 26 14:45:30 2007 +0200 * src/sample: Update manpage, sample config and sample bip.vim + typo * src/bip: warn the user about rlimits upon start and whenever they're reached * src/bip: add -v flag (show version) * src/bip: add admin option to user block, and restrict some commands to admins. Log whenever a /bip command is used * src/bip: enhance /BIP LIST and HELP commands, add INFO command * src: fix defaults user/nick/realnames not loaded into connections, resulting in segfault (WRITE_LINE1 to NULL) and oidentd.conf file not containing usernames * src: add default.h and version.h * src: fflush() system log every log_sync_interval * src/bip: fix "Resetted." printed whenever a client talks with backlog_reset_ontalk true * src/bip: fix backlog user options not set to defaults in add_user * src/bip: fix oidentd.conf config written lately. Still some issues * src/util: add human readable time hrtime(), bool2text() and ssl checlmode2text() functions * src: lower RECONN_TIMER + add RECONN_TIMER_MAX option * src/bip: code some validate_config commit d888825da5441221b14d528324cc2383c201d534 (N) Author: Arnaud Cornet Date: Thu Sep 13 17:24:57 2007 +0200 Raise LAGOUT_TIME to 480. commit ba4b9b99413e2f80548ccf0fd2a6c927e0948a0a (N) Author: Arnaud Cornet Date: Thu Sep 13 17:02:00 2007 +0200 Fix off by one in path allocation for oident file path. Hell, that's lame. commit 7967a47be0a05db4a6c433b9b2eacc2fa3e83305 (N) Author: Arnaud Cornet Date: Sun Sep 9 11:24:21 2007 +0200 Add log_free prototype. commit e9e9549228894795fefce12b4ebb734f339b327f (N) Author: Arnaud Cornet Date: Sat Sep 8 23:51:45 2007 +0200 Reinit logs for a given connection on well chosen times. commit a00a14619342083bcccbb43bb89c713b39a89aa6 (N) Author: Arnaud Cornet Date: Fri Sep 7 01:05:55 2007 +0200 Add some reply when running commands. Remove commented code commit d7e870fe67a56913b59b98945e4b554d686401ae (N) Author: Arnaud Cornet Date: Tue Sep 4 00:24:50 2007 +0200 Lot of cleanups wrt init and killing links Cleanup sample config (make cert). Implement some free functions (log_free and link_kill). Move utility macros in src/util.h Reorganiize initialisation functions. commit 995b3f071aa0e7df03be1a086b9b4942fcf0f409 (N) Author: Arnaud Cornet Date: Mon Sep 3 12:01:13 2007 +0200 Re-open main logfile to allow rotate. Trivial fix. commit a5f890223250767b4e7d73fc24c07f46ad90e838 (N) Author: Arnaud Cornet Date: Sun Sep 2 18:26:27 2007 +0200 Drop autostuff noise. Add boostrap to regenerate it. commit 909fe5e1c1b3871a510c9ba647100d7c0f6dbf97 (N) Author: Arnaud Cornet Date: Sun Sep 2 14:59:19 2007 +0200 Lots of structural changes. Move backlog options to user statment. Drop ircise, to go towards real SIGHUP support. commit 7c4667bf1d42cc002ea41e0ee93f0ca7081081b1 (N) Author: Arnaud Cornet Date: Sun Aug 19 09:59:57 2007 +0200 Fix crash on startup commit aa40fef29aa5f5ed9030657771611d3dfc5f8c8a (N) Author: nohar Date: Fri Jul 20 14:45:33 2007 +0000 Close cleanly. Bug repported by netnut. commit 6273cf2d59ca531c3612bacbd8133f031294d47a (N) Author: nohar Date: Sun Jul 1 12:43:09 2007 +0000 Add configuration directive to be able not to log bip information (not irc related, that is) commit 46bc59b0a6650e6e6977a8e18b42347e9a4b4736 (N) Author: nohar Date: Tue Jun 26 07:37:51 2007 +0000 Compile fix by trou. commit 0546c4baa24d60280d2f08703b512c441ea28ed0 (N) Author: nohar Date: Thu Jun 14 08:48:04 2007 +0000 Set socket flags setting. commit 5bffd8efb8ec616d395bea95a0360990e07dfc45 (N) Author: nohar Date: Thu May 31 22:09:24 2007 +0000 some stuff TODO commit 56fd224916a9bfac6b2c7278a56a4aacbbc30f6d (N) Author: nohar Date: Sat May 26 10:31:44 2007 +0000 Lot's of cleanups. commit ad9c4d7021c42455727b40c727e301657c090928 (N) Author: kyoshiro Date: Wed May 23 20:55:09 2007 +0000 create mandatory directories commit fbd899145f83c5caa847e3b2333da6b6057eddb7 (N) Author: nohar Date: Wed May 23 19:35:22 2007 +0000 Add comment in conf sample file. commit e4e0e8d9fc9941d63f59352642d868da8319e8c0 (N) Author: nohar Date: Wed May 23 19:34:12 2007 +0000 Comment typo fix. commit 88df6fb0cf9655f6541c1eea32d20c1494e5dc60 (N) Author: nohar Date: Wed May 23 19:32:54 2007 +0000 And fix. commit 735743a32158db928665e1ff522457b262ef0728 (N) Author: nohar Date: Wed May 23 19:29:56 2007 +0000 Add comment in sample. commit f7bc5e4d7e0e000fa7b1f86ed68c86b3c796110b (N) Author: nohar Date: Wed Apr 25 07:41:13 2007 +0000 add bug in BUGS. commit bd804576d9783b5c861316164e931ba1df73b804 (N) Author: nohar Date: Wed Apr 25 07:35:13 2007 +0000 Add BUGS. commit cc21d625220134b1ffd00ebdab17de79364cb197 (N) Author: kyoshiro Date: Sat Mar 24 12:47:09 2007 +0000 fix password not quoted commit 220de6e088d520bc6ace359032c6434deb1189d5 (N) Author: kyoshiro Date: Sat Mar 24 11:58:58 2007 +0000 fixes commit c41cc8c15514639436eafaab8ce810d1aa12d90c (N) Author: kyoshiro Date: Fri Mar 23 21:45:03 2007 +0000 todo faq ssl network sample commit c0b86c5e2c7d253900cdea7d3a38e22e30cff5dd (N) Author: nohar Date: Tue Feb 27 21:02:27 2007 +0000 Say somegthing in changelog about a release. commit 957c9a7329892d0ac77b5be79ecd4b5460270c27 (N) Author: nohar Date: Tue Feb 27 20:51:47 2007 +0000 Remove duplicate token definition. commit 211700c5504a98f5a05d56eac0b8bf40388608e6 (N) Author: kyoshiro Date: Sun Feb 25 22:47:42 2007 +0000 add license information commit b056bea2233795d5ff12e1b28524804ead16019b (N) Author: kyoshiro Date: Sun Feb 25 22:35:32 2007 +0000 only lacks current real config load commit b5f1b68893d82cc7cd73382e073d722ef704d588 (N) Author: kyoshiro Date: Sun Feb 25 21:45:03 2007 +0000 bipgenconfig: essential functionnalities should work. Still needs config serialize and current config parse/load commit a60bcec69f9ffe243b4b52c4bb428f82be5104dd (N) Author: nohar Date: Mon Feb 19 22:49:54 2007 +0000 Allow case insensitive TRUST command. commit 0d79c41d4c7859ae4b90a89f0e489de622c52ec5 (N) Author: nohar Date: Sat Feb 17 10:54:21 2007 +0000 Use backlog_ prefix for all backlog config directives. commit d957d132e343432ad84a22acc11cfac3bdd16bc2 (N) Author: kyoshiro Date: Sun Feb 11 23:33:20 2007 +0000 config script nearly finished commit 458abaf45211f7bec3e99c080f9bc1048ecdb2a9 (N) Author: nohar Date: Sat Feb 10 14:05:37 2007 +0000 Fix fd leak. Delay reconnections. commit fd87c58cef3f638d148ce327e1f3f68e7d10fb3b (N) Author: nohar Date: Thu Feb 8 23:14:06 2007 +0000 A fix for rbot on join. Give up more gracefully on error when dumping oidentd commit 052ec2cfbb8cb941d010c3bc1362891cd17a555d (N) Author: nohar Date: Thu Feb 8 23:03:49 2007 +0000 Missing ';' commit 40b9b085c1aa0ee575f94ef2333eb87760b6a4b8 (N) Author: nohar Date: Thu Feb 8 22:56:30 2007 +0000 Keep the changelog up to date, fix year for 2007 modifications. commit faaeb703fdab670fdb850ee18a0a19fe7c8b0464 (N) Author: nohar Date: Thu Feb 8 22:53:48 2007 +0000 Loglevel cleanups. commit 199c62bca853cf1d66080530b7ae20b40b890ef7 (N) Author: nohar Date: Thu Feb 8 19:12:20 2007 +0000 Merge in Trou's oidentd patch. commit eb69ec7bc72820080c925a59ef14ba18234e0023 (N) Author: kyoshiro Date: Fri Feb 2 23:02:09 2007 +0000 rename script commit fdc917b0450582016bceda7e7f983fd436e2388b (N) Author: kyoshiro Date: Fri Feb 2 23:01:41 2007 +0000 remove POSIX dependency commit 7bf018748f8fb2fa3eeb78ca5879fd8c7b6ba70a (N) Author: kyoshiro Date: Fri Feb 2 22:45:51 2007 +0000 bip configuration+make cert script (perl) commit 396dbd0cce606e5f41e9cdf4bb674c61b253ddb4 (N) Author: nohar Date: Thu Feb 1 22:07:10 2007 +0000 Fix AUTHORS commit bd86d50c143c6d56361a301d4f1e7b28247a6301 (N) Author: nohar Date: Wed Jan 31 20:49:20 2007 +0000 Update bip help message. commit 965aeb9f6adb41fb1d92384e8fa9aa47c99ae80c (N) Author: nohar Date: Sun Jan 28 18:35:30 2007 +0000 Fixed a compile warning. commit e8775c36c783a162350b7d24db6b012527ab1a97 (N) Author: kyoshiro Date: Sat Jan 27 20:53:03 2007 +0000 add new options to bip.vim syntax file add a readme for anti flood systems commit 2cccffb30ecd3327ccfe2896fe86eff7da5c97bc (N) Author: nohar Date: Sat Jan 27 20:47:56 2007 +0000 /me whistles... commit 931050deba4e1da8f90fd403bedf1161414d864a (N) Author: nohar Date: Sat Jan 27 20:24:55 2007 +0000 This was used for debug only. commit 27e6f3a50f9da0807c945356fec6fabb1b18f513 (N) Author: nohar Date: Sat Jan 27 15:07:24 2007 +0000 Be less demanding on the PONG reply to work with 2ch network. commit a31562f51933cc9d217d45a7048e5f80cd335cbd (N) Author: nohar Date: Sat Jan 27 12:30:12 2007 +0000 Bug fix in nick channel nick tracking commit 2855993dadadea2f833de232c9ae6c5fd49ddb31 (N) Author: nohar Date: Sat Jan 27 10:16:01 2007 +0000 drop the coucou commit e6b7672a199f3a6f7413e191ef7c16096d99606e (N) Author: nohar Date: Fri Jan 26 18:52:21 2007 +0000 New nick mgmt code commit a2a8e0a1939533eb1f601a5dcef5ff4aac1c7106 (N) Author: nohar Date: Fri Jan 12 22:19:29 2007 +0000 blah commit 9e3d62764f856779b78483ec55c1414bbd251a48 (N) Author: nohar Date: Fri Jan 12 18:49:14 2007 +0000 backlog_no_timestamp option implemented commit ccd2274772327daf177844ba0f933827c480abcc (N) Author: nohar Date: Fri Jan 12 18:34:45 2007 +0000 /msg to -bip is now equivalent to /quote bip. commit 8b46e5f04f8b853c85d03574a9162611552010b5 (N) Author: nohar Date: Sun Jan 7 12:02:36 2007 +0000 Update changelog, I should do that more often. commit 006f5c07e5fb5bb20626f42c9ab02f4e2831f8e7 (N) Author: nohar Date: Fri Jan 5 22:20:17 2007 +0000 I forgot that my hash lib function was braindead. commit 0194ae7c47a93708654b59fce081b56052af7001 (N) Author: nohar Date: Fri Jan 5 21:27:35 2007 +0000 Update build sys, try 3 commit c77ee1e963f840176997bb95ee01d32892f39fe2 (N) Author: nohar Date: Fri Jan 5 21:25:32 2007 +0000 Update build sys, try 2 commit 8d1913b38053b56e14990b225c16e1bf887898f3 (N) Author: nohar Date: Fri Jan 5 21:22:30 2007 +0000 Update build system. commit 5c17d27a9582de9ced5a55dc77616ce100b97d3a (N) Author: nohar Date: Fri Jan 5 21:19:32 2007 +0000 Re-think who_count management. Should fix hard to trigger bug: fatal("negative who_count"). commit a7d21b2693a71bcacffcfe70fffc8fe17570c926 (N) Author: nohar Date: Fri Jan 5 21:18:34 2007 +0000 Drop Makefile.in commit 4e12ff1c949245bcd6f17e8fd1bb627ca881cc30 (N) Author: nohar Date: Fri Dec 8 21:08:23 2006 +0000 Hash fonction just for fun. commit 70ae2161224618dcc1aab3ad632f1f50296d57de (N) Author: nohar Date: Wed Nov 22 22:06:06 2006 +0000 Fix error message. commit f6d710bdeec2218fb592911b4eb3bfa5e0e2e9ce (N) Author: nohar Date: Thu Nov 16 14:34:28 2006 +0000 Fix backlogging display bug. How come nobody ever saw this one ? Drop conf.h from svn since it is autogenerated. commit 13e329450198439b7586c7e39ee65cfe607e96e9 (N) Author: nohar Date: Thu Nov 16 13:36:24 2006 +0000 YAY! a readme file ! commit 2e8c820dbbd45d1a339004fdc656038e16454e7b (N) Author: kyoshiro Date: Wed Nov 15 21:13:51 2006 +0000 lex/conf.y cleanups vim syntax, manpage, sample conf file updates commit 91f362391bad11f86970a74fd535d54c7e8aca97 (N) Author: kyoshiro Date: Wed Nov 15 16:18:56 2006 +0000 Add a script to generate bip.pem commit afa77d12b5a8e7604808cf83d591ab1179ff1424 (N) Author: nohar Date: Sun Nov 12 18:08:49 2006 +0000 Implement ban reply redirrection to the requesting client only. commit ae65ababf111a8a4f629169271b1cdd633289ea9 (N) Author: nohar Date: Sun Nov 12 13:22:32 2006 +0000 Fixed empty line bug. commit 98dcc2e4d4cdc06505f238579b075a70fd29f66d (N) Author: nohar Date: Sat Oct 21 12:06:31 2006 +0000 bl_msg_only commit 7aa6305280f9ce045820ce7ded083ec933fdaee9 (N) Author: nohar Date: Sat Oct 21 10:36:56 2006 +0000 proper daemonize commit 38f84edc01741e6f08c27efded1f43acb7db2bec (N) Author: nohar Date: Mon Sep 25 12:08:31 2006 +0000 Debug away msg when no client on. commit c13c58157bac08986694fea408c6aa5dea2ad96c (N) Author: nohar Date: Sat Sep 23 14:13:27 2006 +0000 Untested ipv6 support for fake ident with oidentd. commit f02ce0fb0379813b6dbc0e57df1ff4b7b709b90e (N) Author: nohar Date: Wed Sep 20 20:30:25 2006 +0000 Typo in man page. commit 28d396112d653753e2a4044e06ee52fc4bde219b (N) Author: nohar Date: Wed Sep 20 20:27:14 2006 +0000 Rights fix, working multiple on connect send. commit e3410afe934fcd04545789ffe1a587c46a4c7074 (N) Author: nohar Date: Mon Sep 18 18:05:17 2006 +0000 Now it even build commit 925bee51c8edc44adf46056d3461f5910103520f (N) Author: nohar Date: Mon Sep 18 16:06:23 2006 +0000 Untested no_client_away_msg support. commit a4fe5d08616fdcad77a7692ace358dec81b23bf6 (N) Author: nohar Date: Thu Aug 31 07:57:39 2006 +0000 TODO file update commit acb4b9570dcf0a37549336a9a80197d9c8692d53 (N) Author: nohar Date: Wed Jul 12 18:10:32 2006 +0000 add a pid_file in bip.conf sample. commit 509d8bb11740bf06045bd48b93a4ee59526d7aa8 (N) Author: nohar Date: Mon Jul 10 22:19:25 2006 +0000 update changelog entry commit 5e3a7631d9c57b8af158360dd15ffb9fbf1be7ed (N) Author: nohar Date: Mon Jul 3 22:14:02 2006 +0000 todo update commit ac6d1eaa7c07a8885749c48cbd09aedb1b0f0271 (N) Author: nohar Date: Sun Jul 2 13:51:43 2006 +0000 Drop freenode from config file commit e2e889d640a9f444559d60e05723c8d35c74e239 (N) Author: nohar Date: Sun Jul 2 13:32:00 2006 +0000 getopt bugfix commit dace58405fca4cda67efd5b9c521456e75d051d9 (N) Author: nohar Date: Sun Jul 2 13:24:43 2006 +0000 add -s option to set bip homedir commit cd098c85ba72875623308694245ca2eabd90300f (N) Author: nohar Date: Sun Jul 2 13:02:55 2006 +0000 SSL Cert path computation fix commit 2ba9ccac5c2c9585eabd35fc811931485e400260 (N) Author: nohar Date: Sun Jul 2 12:57:23 2006 +0000 buf manipulation fixes commit b4d73d22da24f6d9a17c7024f7113bf348e87664 (N) Author: kyoshiro Date: Sun Jul 2 12:44:22 2006 +0000 oops commit c1f07926f36ceb6199fd3b47c6698f5dd77cb048 (N) Author: kyoshiro Date: Sun Jul 2 12:35:32 2006 +0000 Enhance /bip list a bit... commit f73f69b6e726db15206aab4953ed8f565d81302f (N) Author: nohar Date: Sun Jul 2 12:04:51 2006 +0000 Never forget the changelog commit 71108cbe935a1a4bd4ff7111a0d1a2fe0d149c4d (N) Author: nohar Date: Sun Jul 2 11:50:20 2006 +0000 New /bip commands commit fa9b404fd15644ff825e64d5196c0a371351f393 (N) Author: nohar Date: Thu Jun 22 12:13:34 2006 +0000 remove useless tabs commit 9795b1145b2d5965a05d46e084a891da31e90138 (N) Author: nohar Date: Tue Jun 20 11:31:22 2006 +0000 Add a fatal. commit 643573969de38118b653e534e9a507aea3895ab6 (N) Author: nohar Date: Thu Jun 8 18:55:51 2006 +0000 Fixed date in changelog commit f80cdd85e0b445e3743dcbe0aa55c24d164cd010 (N) Author: nohar Date: Thu Jun 8 18:55:26 2006 +0000 - change default nick in sample file - fix nick desync between client and server - fix possible null deference commit e7a10369c3f344e9399485b9e14144b525cc938a (N) Author: nohar Date: Sun Apr 23 16:38:57 2006 +0000 Fix for bad bug when client closes and server not connected with away_nick option. commit 35fa0257928838c537594dd1dbe88be548a08e0b (N) Author: nohar Date: Thu Apr 20 12:51:46 2006 +0000 Note for later: stop smoking. commit baad17c4d9a3f5ceba376f1680c5a3a27f483d82 (N) Author: nohar Date: Thu Apr 20 12:49:50 2006 +0000 This should have been fixed already. commit df62973affb29c299fd7031c8054d94adf3c96d1 (N) Author: nohar Date: Wed Mar 8 18:26:04 2006 +0000 log the release commit 041d7909a2fc1315b5db39d56bf5d22f71ae3606 (N) Author: nohar Date: Tue Mar 7 21:35:09 2006 +0000 don't forget to update the changelog commit 1b22c1acf63d2835dd5bc35f59f245d3a9ca68f1 (N) Author: nohar Date: Tue Mar 7 21:33:10 2006 +0000 count one mode arg on +e commit 7c261439775135b32833be2e362614439e09c4ac (N) Author: nohar Date: Mon Mar 6 18:25:31 2006 +0000 fix typo commit 47d82fdd2a91d5835f8649f22202b4ba73ab4329 (N) Author: nohar Date: Tue Feb 21 07:48:12 2006 +0000 Who patch fix commit 4055764e819cb0bb70f41020f89eb349b04d7b67 (N) Author: nohar Date: Sun Feb 5 11:10:33 2006 +0000 Merged lappz patch for better who reply handling commit 8aa77d202ab8c0260c2e80eff3e8c701ca658ad2 (N) Author: nohar Date: Fri Feb 3 13:01:02 2006 +0000 Don't mess source and debian stuff commit 6fa60fc4964ae0875d0a3288465bc7ad29930fef (N) Author: nohar Date: Thu Feb 2 09:31:23 2006 +0000 Add a password protected channel in sample file. commit 08050235ed4527eb829d889e6a00d21b11a2dbdc (N) Author: nohar Date: Thu Feb 2 09:00:42 2006 +0000 fixes SEGV if no HOME environment var commit ebc7ec7f4e3f94cf3da26b5887316e21c85345e3 (N) Author: nohar Date: Tue Jan 31 19:14:37 2006 +0000 debian's copyright in sync commit cba063a0a5b71b392341c991f6bec6b2f9572c18 (N) Author: nohar Date: Tue Jan 31 17:24:53 2006 +0000 new missing file and autoheader commit c8890d7febdfa82c194b53c05ea82543ba391f4f (N) Author: nohar Date: Sun Jan 29 21:23:43 2006 +0000 debian stuff commit 6ab69228ac25e21f0ef83b0796300f67153fc8c2 (N) Author: nohar Date: Sun Jan 29 21:16:34 2006 +0000 this file is for automake commit 293812ec64fc09269027da4edb27906021b9890b (N) Author: nohar Date: Sun Jan 29 21:14:20 2006 +0000 Bump version to 0.5.1, go with a newer automake commit 02734b52e887629f002b99ab54e2128ce630313e (N) Author: nohar Date: Fri Dec 30 22:56:25 2005 +0000 blackmore repported this error in sample => no_backlog is backlog commit 64970e041fb04b4c568f59654a5fe0688524816e (N) Author: nohar Date: Wed Dec 28 13:18:29 2005 +0000 jake_@freenode spotted this one commit de0d5efc3459739be3fbf215652db900a74736e7 (N) Author: nohar Date: Wed Dec 14 22:11:38 2005 +0000 bipmkpass => bipmkpw in bin.conf sample commit 5574a6d335131d28e6265802dc8ab0fa65fec06d (N) Author: nohar Date: Mon Dec 12 19:03:02 2005 +0000 a few deleted whitespaces + Trou's patch: allows to trust when not connected / allow self-signed certs when in basic ssl mode / permit connection to serveurs w/o a motd commit 6a1ec2724b66aa2b8c5aadcbcee558f144c3f2c7 (N) Author: nohar Date: Sun Nov 20 17:07:26 2005 +0000 boulette quequette! commit 1e6f0593fb1ef9cb096289b52bcc05580e358c09 (N) Author: kyoshiro Date: Thu Nov 17 17:55:12 2005 +0000 clean README and TODO files loglevels cleanup debug prints cleanup log info when connecting to a server default log level to INFO commit ad86ed411de5b6ffbb78c6dff755eece8f0d1afc (N) Author: nohar Date: Thu Nov 17 15:36:19 2005 +0000 typos commit fc058e09d6912a30f9ec54bb6f2d1a74cd71df38 (N) Author: nohar Date: Thu Nov 17 14:26:56 2005 +0000 relicencing: add a exception clause to GPL to allow redistribution linked to OpenSSL commit b039415b93bb04a5072eecb126e6aab3aa206799 (N) Author: nohar Date: Wed Nov 16 18:34:25 2005 +0000 voice storage bugfix, probably commit 486f28db9aaed516bdb02d24cffd6e50b5272d25 (N) Author: nohar Date: Wed Oct 19 08:04:50 2005 +0000 merged debian packaging stuff, fixed a name spelling in authors commit f4ae1effc8f99a73493094ba6ebb2621c4e847b1 (N) Author: nohar Date: Tue Oct 18 08:00:55 2005 +0000 man fixe, author fixes commit 73226ebfa90829d36245a8c485d4fa55202df6f7 (N) Author: kyoshiro Date: Tue Oct 11 16:59:45 2005 +0000 manpage format fixes commit 709bb6b7e506589d080641cafdca71a03abfa6b2 (N) Author: nohar Date: Tue Oct 11 08:49:27 2005 +0000 few bip.conf.1 fixes commit c6e9246adb1d2716ff3783974eff9d8fb13ef046 (N) Author: kyoshiro Date: Mon Oct 10 21:56:39 2005 +0000 1st version of bip.conf manpage needs reformatting and some spell checking maybe commit 54492bc4ae3758b0a14ba37c1ef0f333eaa8a73b (N) Author: nohar Date: Mon Oct 10 15:31:20 2005 +0000 bipmkpw man page commit 758a80030b209f3438d14e0820d2bc58a13e2572 (N) Author: nohar Date: Mon Oct 10 12:18:47 2005 +0000 configure.in fix and bip man added commit c27294e084e10063e280e0772ade94eb0e0fcc95 (N) Author: nohar Date: Sun Oct 9 12:40:38 2005 +0000 tiny fixes, debian/ mostly commit f4f0cda8491d776a49fecfc410a31cb20f51c827 (N) Author: nohar Date: Sun Oct 9 11:47:20 2005 +0000 cleanup for release commit f75466972c0e2f7e532323442eb9e8a061558c1b (N) Author: nohar Date: Thu Sep 15 22:23:26 2005 +0000 Maybe i'll manage to fix this one day commit 53eaf0d767e672663d785d9b2e12b0aabc01f2c5 (N) Author: nohar Date: Fri Sep 2 12:50:59 2005 +0000 Try to detect client side socket kernel buffer fillup commit fd91cba6d01d3162b94b6fd396d8f2fb4a77235c (N) Author: nohar Date: Sat Aug 27 13:25:57 2005 +0000 pretty sure kyo's bug is fixed now commit 339828202fef1df698331790f7551cde3002f0ff (N) Author: nohar Date: Sat Aug 27 08:24:55 2005 +0000 small fix, maybe fixes kyo's bug commit e245735f7107119211251b26d8bc59f88a8470e1 (N) Author: nohar Date: Thu Aug 25 08:17:10 2005 +0000 merged YS' elite cert management patch commit e32c1c1f1dd588be44e2db264a2891087a1cf40b (N) Author: nohar Date: Wed Aug 24 22:54:46 2005 +0000 I was on crack this day commit b3aa4c73dc3f1d52f297376482db6fa334b0eb8c (N) Author: kyoshiro Date: Tue Aug 23 08:53:13 2005 +0000 fix away_nick not used at server connect when follow_nick is defined commit 04e17c835979baa08ed8895ef0ce7a260bf5eac6 (N) Author: nohar Date: Thu Aug 18 07:57:46 2005 +0000 Have client rejoin on connect/reconnect commit 2afd09e3dea4f784ee180bf03f2ba325eb6dc4f7 (N) Author: nohar Date: Tue Aug 16 14:03:33 2005 +0000 merge blackmore's configure.in patch one type and a small connection close fix commit 574841d9e37292c94de6e23f463269c62586fd97 (N) Author: nohar Date: Sat Aug 6 16:11:21 2005 +0000 remove extra printf commit 4c2aa74c36143c93e4c36e024e6d897d8b992570 (N) Author: nohar Date: Sat Aug 6 11:47:09 2005 +0000 segv bugfix commit 75458e014bec79ed45d832a06e25ded36f04bbc4 (N) Author: nohar Date: Thu Aug 4 12:40:09 2005 +0000 MAMADOO chat sux commit 76002fe2dd021ffddead2346faffa674a8e7abb2 (N) Author: nohar Date: Thu Aug 4 07:59:38 2005 +0000 Jere proved me that shit DOES happen. Now I know commit 26edb7a22930fc85750b1834fbe2f3201ad9681d (N) Author: nohar Date: Tue Aug 2 10:11:47 2005 +0000 be consistant irc.proxy.net => irc.bip.net commit 4f3812865beb5d6308a910944a550c8087c63f7b (N) Author: nohar Date: Mon Aug 1 15:13:35 2005 +0000 autoconf/make sux commit cdcf96758d5bf483b7e11531daacb88ea4e56fe3 (N) Author: nohar Date: Mon Aug 1 15:08:18 2005 +0000 drop -Werror 'cause of flex commit 69562cdabc4630ce3ef82c0b555c0b5e9c089e55 (N) Author: nohar Date: Mon Aug 1 11:43:17 2005 +0000 revert lex compile-without-a-warning hack commit b4deba4b8c91bf08e1a701fd7ef540cef601af0f (N) Author: nohar Date: Mon Aug 1 11:41:14 2005 +0000 automake/auotconf gory stuff commit 9c7eba2f6a28ac32e147aa6702f5b95a93b24ebf (N) Author: guillot Date: Mon Aug 1 11:24:10 2005 +0000 fixed compilation warnings commit 0e6af5bcf6de7a345f81a41d08256efb8276d531 (N) Author: nohar Date: Mon Aug 1 11:16:39 2005 +0000 lame bug found by jj commit 2c4b77fab04ebd8365e8d68abfb9b73159dda94b (N) Author: nohar Date: Mon Aug 1 09:15:25 2005 +0000 Backlog and logging fixes commit 8df2b019dfb160a4094ca96ae7f706361441c748 (N) Author: nohar Date: Mon Jul 25 08:27:03 2005 +0000 Kick instead of part when server disconnects to keep window open in irssi commit 783405e504cd824b9a46f7fd90f416c9795b7c3c (N) Author: guillot Date: Tue Jul 12 22:24:04 2005 +0000 rewrite of log_beautify, did strange things... commit 7f5750b3b4d86b3327919fe31893886d7cdfe94e (N) Author: guillot Date: Tue Jul 12 19:31:59 2005 +0000 minor update of flood control enabled more secure prompting for the highly critical "bipmkpw" util commit 5722685126e9d2a7b7b21dcff344591e4667671e (N) Author: guillot Date: Tue Jul 12 19:30:10 2005 +0000 removed useless check disallowing backlog_lines = 0 with always_backlog commit 482420e8843a51ce011979b6d65da206f218cc96 (N) Author: guillot Date: Tue Jul 12 19:24:26 2005 +0000 updated comments to reflect the new semantic commit c97237be03078faaa8efdf39a0ebc4cf4d85b3dc (N) Author: nohar Date: Sat Jul 9 12:57:15 2005 +0000 some info in sample conf commit 3b9af8d5bd09c99c31511bff8011a4dab0fa6642 (N) Author: nohar Date: Sat Jul 9 12:55:01 2005 +0000 new auth mechanism commit d1f0055b6831f0b812f0e95812b155026b843563 (N) Author: nohar Date: Thu Jun 23 08:01:54 2005 +0000 fix replay of backlog line starting with '(' commit 466ec98adbf056f9c5b565d898c6e3af5c88dba0 (N) Author: nohar Date: Sat Jun 4 14:54:17 2005 +0000 YS's fixs for in ssl checkstore commit 38e046b99e7bb726522d82d1b3e09cfa20a56383 (N) Author: nohar Date: Sat Jun 4 14:00:23 2005 +0000 boot lex.c out of svn repo commit 3a51245c1454fe6783158c1409ecfb3918e84035 (N) Author: nohar Date: Sat Jun 4 11:05:54 2005 +0000 YS' SSL certification check patch merged commit 6135a13810f4300119eae2342cd93fff95a3bab2 (N) Author: nohar Date: Sat Jun 4 10:39:04 2005 +0000 fatal("internal log_client_none_connected") fix; /me backlog with freenode fixed commit 36e809b8898d7d42c77e53e8462fc8245299eb17 (N) Author: nohar Date: Mon May 30 18:35:49 2005 +0000 channel order in conf honnored commit 811d7cb04831b0717de5c69f4a48abdee9ec2372 (N) Author: nohar Date: Mon May 30 18:01:00 2005 +0000 blreset_on_talk, plus a fix in log_reset commit 8f09db3184402342a89c7a42988d0aa632612931 (N) Author: nohar Date: Mon May 30 13:20:17 2005 +0000 log ircmask on quit commit cb2f3a5e1e237bd100eb8ebc933b537756c7e16e (N) Author: nohar Date: Sun May 29 23:00:30 2005 +0000 /bip blreset implemented commit db676b3221fb944afe2035832a18743621e73c1d (N) Author: nohar Date: Sun May 29 13:42:50 2005 +0000 better queries management, when multiple clients on same link commit 0de53a249940a00e4ce78b534ee0bdd527164134 (N) Author: nohar Date: Sat May 28 23:08:54 2005 +0000 fix queries backlog commit 3aeb6fc9fffd4e2ba8f63b265e85cb51dc366b50 (N) Author: nohar Date: Sat May 28 13:23:51 2005 +0000 looping on cpu on throttle fixed commit 822f720e0e42c3253c73b88676087d94feefef16 (N) Author: nohar Date: Fri May 27 16:50:26 2005 +0000 QUIT message when quitting commit 14cf13cfb6a6966d35348fa64e2de18deaa81f28 (N) Author: nohar Date: Fri May 27 15:00:11 2005 +0000 fix: wait_event now waits when there is no socket active (that happens when we to nothing but wait for a reconnect timeout to trigger) commit d9a149b4dd2075fad4433d6524f17e79663141d3 (N) Author: nohar Date: Fri May 27 10:25:31 2005 +0000 use connect timestamp instead of reconnect commit 04dc4526cc02d1f319dd99e71224e73d5776891c (N) Author: nohar Date: Thu May 26 15:36:15 2005 +0000 Conf cleanup, PING colon in reply commit 0c375a44426df54311882a716cfdc4f91f9e5862 (N) Author: nohar Date: Mon May 23 23:05:11 2005 +0000 gory throttle avoidance. may drop commit 29cea3ef41b238ce93f6ac58684b8bdb80357cbb (N) Author: nohar Date: Mon May 23 22:55:04 2005 +0000 guinness DEFINITELY *IS* good for codaz commit a5739325b657f59a8e7de48f785e8f9d9fe039f7 (N) Author: nohar Date: Mon May 23 22:51:33 2005 +0000 tonight, guinness is my inspiration commit abd979fb01661147c8c6a710fc03b57b8de1285a (N) Author: nohar Date: Mon May 23 06:27:26 2005 +0000 Damn old backlog bug finally fixed. Happiness. Joy. commit 152e5324d53440832ec63c15214ed11d3cfa3d77 (N) Author: nohar Date: Sat May 21 14:35:22 2005 +0000 bipmkpw compiles again commit 5ad0a47e6859c6033e062e9b0eb2a1f2e98414b8 (N) Author: nohar Date: Sat May 21 14:23:05 2005 +0000 don't touch bip.log if log = false commit ed8f084daedf86901e22829d1831150d33492340 (N) Author: nohar Date: Sat May 21 13:44:09 2005 +0000 Log/backread cleanup, plus small fixes commit 3a46247bd475fcb3c7a587d62a827ecd0bd86356 (N) Author: nohar Date: Thu May 19 20:55:11 2005 +0000 better log file format, log options, with backlog with memory based backlog commit 5e939ecd4dc0a30f66cd686a9daad6b617b9ebac (N) Author: kyoshiro Date: Wed May 18 23:31:14 2005 +0000 update todo, important ! fix ssl not timeouting with some sort of bogus SSL sockets... commit de0d75b181d299d47cde188d8f1444cd9abacf43 (N) Author: nohar Date: Tue May 17 12:52:12 2005 +0000 Don't log privmsg before 001 commit a1b84c67b14f1da813b82648ddd2a53c28f57857 (N) Author: nohar Date: Tue May 17 09:27:09 2005 +0000 renamed bip.syslog to bip.log, changed backread verbosification, still seeking for the very rare backlog formatting bug commit 43384d8bd5d80c38f0635e12818c4c673803045f (N) Author: nohar Date: Sun May 15 22:46:28 2005 +0000 better loggin on auth error commit e9884c5b0307a8b21605e336e07a351a09eac0b8 (N) Author: nohar Date: Sat May 14 08:08:37 2005 +0000 backlog enhancement + verbosification fix commit 103a9f036909cb2717a8bb479fc9a71b22d7483f (N) Author: kyoshiro Date: Fri May 13 13:58:24 2005 +0000 fix oidentd spoof remove old unsued spoof functions commit 9a005cbb80cd790dbd1690e15082b633633bbff4 (N) Author: nohar Date: Fri May 13 10:28:15 2005 +0000 sexy backlog (untested) commit 0a9a61954f7bb63b9082f46b1e3a1a79665f7a68 (N) Author: nohar Date: Fri May 13 08:43:50 2005 +0000 backlog leak fix, backlog verbosification for debug, sign fix commit a48019b5fde01fd42f6911e2a0f99c34ec9f98c5 (N) Author: nohar Date: Thu May 12 08:29:27 2005 +0000 oidentd suppport commit f66513d22477bf96ef4582961bc61b2f35162a2e (N) Author: kyoshiro Date: Wed May 11 14:09:20 2005 +0000 add functions to determine local/remote ip/port from a connection_t object commit d1e92bf535d1fe6cd77db74a602f56f6bf76c578 (N) Author: kyoshiro Date: Wed May 11 12:26:21 2005 +0000 Update vim file commit f5c54c662a743978c3fc0417878fd13d53b13efa (N) Author: nohar Date: Sun May 8 21:09:11 2005 +0000 cosmetic backlog bugfix commit 67abb60976d286b19bdf4dc81d12efb86abd643b (N) Author: nohar Date: Wed May 4 08:13:43 2005 +0000 give a proper name to genpwent commit 81ffe1b550254465f19aefc492a9182c58fea4a8 (N) Author: nohar Date: Sun May 1 22:29:31 2005 +0000 fix for early RST on new connection to proxy commit 8da1c833d86f05b1c8c549c14b88c7fc2005ceb5 (N) Author: nohar Date: Thu Apr 28 08:30:43 2005 +0000 This is starting just fine ;) commit 665d2ec5af6e8a97461df7dbc31e5540464ad6fb (N) Author: nohar Date: Thu Apr 28 08:26:44 2005 +0000 Initial import bip-0.9.3/BUGS0000664000175000017500000000005212442320231007671 00000000000000- make install fails to install examples. bip-0.9.3/TODO0000664000175000017500000000276313051303063007712 00000000000000- Allow to dump a config file, so that when the config is dynamically changed, we can find it back after bip restart. - allow global (or per net ?) IP filtering - DCC proxying... - encrypt logs - pre_on_connect_send => before join - use gnutls - MODE #channel and WHO #channel on join - this: Hi Arnaud, is it possible to implement a secondary nick option? If I'm connected directly to IRC, it would be great if BIP fallbacked to the secondary nickname. I saw that BIP uses the default nickname + a "`". Where could I change it to default nickname + "_"? Thanks a lot for your help. Best regards, Whoopie -- 23:46 < nixternal> i have a question...when i log into my bip server with more than 1 client at a time...i get a mass "ban message" from the server..notice of all channel bans that i am in 23:52 < nohar> one of you client is downloading the ban list 23:52 < nohar> an both recieve the reply 23:52 < nixternal> ahhh 23:52 < nixternal> i am using konversation..so i need to figure how to shut that off 23:53 < nixternal> the ban list for 50 channels sucks ;) 23:53 < nohar> yeah i don't know if you can disable this in konversation. maybe we should code a hack for the ban reply to go only to the client that asked for it 23:54 < nohar> there is such thing for /who already _____________ FAQ: - why I cannot add non-ssl servers with ssl-servers - why is my vhost not used when I connect (one IP) - backlog_no_private bip-0.9.3/AUTHORS0000664000175000017500000000063314212335655010300 00000000000000Arnaud 'nohar' Cornet Loïc 'Kyoshiro' Gomez Sexy contributors: Yoan 'jj' Guillot: fixes Yannick 'YS' Schaus: SSL cert stuff Raphaël 'Trou' Rigo: fixes Thanks to our marketting and management team: ack|, ato, blackmore, lafouine, Gaston & gromit Crypto shamelessly stolen from Christophe 'sexy' Devine. Credits to Jouni Malinen for base64 library (http://web.mit.edu/freebsd/head/contrib/wpa/src/utils/) bip-0.9.3/src/0000775000175000017500000000000014212410721010061 500000000000000bip-0.9.3/src/bip_main.c0000664000175000017500000001672714212375475011760 00000000000000/* * $Id: bip.c,v 1.39 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "irc.h" #include "conf.h" #include "path_util.h" #include "tuple.h" #include "log.h" #include "bip.h" #include "line.h" #include "defaults.h" #define S_CONF "bip.conf" #define OIDENTD_FILENAME ".oidentd.conf" extern int sighup; extern char *conf_log_root; extern char *conf_log_format; extern int conf_log_level; extern char *conf_ip; extern unsigned short conf_port; extern int conf_css; #ifdef HAVE_LIBSSL extern char *conf_ssl_certfile; extern char *conf_client_ciphers; extern char *conf_client_dh_file; extern char *conf_server_default_ciphers; #endif extern int conf_daemonize; extern char *conf_pid_file; extern char *conf_biphome; extern int conf_reconn_timer; /* log options, for sure the trickiest :) */ extern int conf_log; extern int conf_log_system; extern int conf_log_sync_interval; extern bip_t *_bip; extern FILE *conf_global_log_file; void reload_config(int i); void bad_quit(int i); void check_rlimits(void); void rlimit_cpu_reached(int i); void rlimit_bigfile_reached(int i); void conf_die(bip_t *bip, char *fmt, ...); int fireup(bip_t *bip, FILE *conf); int do_pid_stuff(void); static void usage(char *name) { printf("Usage: %s [-f config_file] [-h] [-n]\n" " -f config_file: Use config_file as the configuration file\n" " If no config file is given %s will try to open ~/.bip/" S_CONF "\n" " -n: Don't daemonize, log in stderr\n" " -s: Bip HOME, default parent directory for client certificate,\n" " configuration, logs, pid, oidentd\n" " -v: Print version and exit\n" " -h: This help\n", name, name); exit(1); } static void version(void) { printf("Bip IRC Proxy - " PACKAGE_VERSION "\n" "Copyright © Arnaud Cornet and Loïc Gomez (2004 - 2008)\n" "Distributed under the GNU General Public License Version 2\n"); } static void log_file_setup(void) { char buf[4096]; if (conf_log_system && conf_daemonize) { if (conf_global_log_file && conf_global_log_file != stderr) fclose(conf_global_log_file); snprintf(buf, (size_t)4095, "%s/bip.log", conf_log_root); FILE *f = fopen(buf, "a"); if (!f) fatal("Can't open %s: %s", buf, strerror(errno)); conf_global_log_file = f; } else { conf_global_log_file = stderr; } } static pid_t daemonize(void) { switch (fork()) { case -1: fatal("Fork failed"); break; case 0: break; default: _exit(0); } if (setsid() < 0) fatal("setsid() failed"); switch (fork()) { case -1: fatal("Fork failed"); break; case 0: break; default: _exit(0); } close(0); close(1); close(2); /* This better be the very last action since fatal makes use of * conf_global_log_file */ return getpid(); } int main(int argc, char **argv) { FILE *conf = NULL; char *confpath = NULL; int ch; int r, fd; char buf[30]; bip_t bip; bip_init(&bip); _bip = &bip; conf_ip = bip_strdup("0.0.0.0"); conf_port = 7778; conf_css = 0; signal(SIGPIPE, SIG_IGN); signal(SIGHUP, reload_config); signal(SIGINT, bad_quit); signal(SIGQUIT, bad_quit); signal(SIGTERM, bad_quit); signal(SIGXFSZ, rlimit_bigfile_reached); signal(SIGXCPU, rlimit_cpu_reached); conf_log_root = NULL; conf_log_format = bip_strdup(DEFAULT_LOG_FORMAT); conf_log_level = DEFAULT_LOG_LEVEL; conf_reconn_timer = DEFAULT_RECONN_TIMER; conf_daemonize = 1; conf_global_log_file = stderr; conf_pid_file = NULL; #ifdef HAVE_LIBSSL conf_ssl_certfile = NULL; conf_client_ciphers = NULL; conf_server_default_ciphers = NULL; conf_client_dh_file = NULL; #endif while ((ch = getopt(argc, argv, "hvnf:s:")) != -1) { switch (ch) { case 'f': confpath = bip_strdup(optarg); break; case 'n': conf_daemonize = 0; break; case 's': conf_biphome = bip_strdup(optarg); break; case 'v': version(); exit(0); break; default: version(); usage(argv[0]); } } umask(0027); check_rlimits(); char *home = NULL; /* oidentd path searching ignores conf_biphome */ home = getenv("HOME"); if (!home && !conf_biphome) { conf_die(&bip, "no value for environment variable $HOME," "use '-s' parameter"); return 0; } if (!conf_biphome) { conf_biphome = bip_malloc(strlen(home) + strlen("/.bip") + 1); strcpy(conf_biphome, home); strcat(conf_biphome, "/.bip"); } if (!bip.oidentdpath) { bip.oidentdpath = bip_malloc(strlen(conf_biphome) + 1 + strlen(OIDENTD_FILENAME) + 1); strcpy(bip.oidentdpath, conf_biphome); strcat(bip.oidentdpath, "/"); strcat(bip.oidentdpath, OIDENTD_FILENAME); } if (!confpath) { confpath = bip_malloc(strlen(conf_biphome) + 1 + strlen(S_CONF) + 1); strcpy(confpath, conf_biphome); strcat(confpath, "/"); strcat(confpath, S_CONF); } conf = fopen(confpath, "r"); if (!conf) fatal("config file not found (%s)", confpath); r = fireup(&bip, conf); fclose(conf); if (!r) fatal("Not starting: error in config file."); if (!conf_log_root) { char *ap = "/logs"; conf_log_root = bip_malloc(strlen(conf_biphome) + strlen(ap) + 1); strcpy(conf_log_root, conf_biphome); strcat(conf_log_root, ap); mylog(LOG_INFO, "Default log root: %s", conf_log_root); } if (!conf_pid_file) { char *pid = "/bip.pid"; conf_pid_file = bip_malloc(strlen(conf_biphome) + strlen(pid) + 1); strcpy(conf_pid_file, conf_biphome); strcat(conf_pid_file, pid); mylog(LOG_INFO, "Default pid file: %s", conf_pid_file); } #ifdef HAVE_LIBSSL if (conf_css) { int e; struct stat fs; if (!conf_ssl_certfile) { conf_ssl_certfile = default_path( conf_biphome, "bip.pem", "SSL certificate"); } assert_path_exists(conf_ssl_certfile); e = stat(conf_ssl_certfile, &fs); if (e) mylog(LOG_WARN, "Unable to check PEM file, stat(%s): " "%s", conf_ssl_certfile, strerror(errno)); else if ((fs.st_mode & S_IROTH) | (fs.st_mode & S_IWOTH)) mylog(LOG_ERROR, "PEM file %s should not be world " "readable / writable. Please fix the modes.", conf_ssl_certfile); if (conf_client_dh_file) { assert_path_exists(conf_client_dh_file); } } #endif check_dir(conf_log_root, 1); fd = do_pid_stuff(); pid_t pid = 0; log_file_setup(); if (conf_daemonize) pid = daemonize(); else pid = getpid(); snprintf(buf, (size_t)29, "%lu\n", (unsigned long int)pid); ssize_t written; written = write(fd, buf, strlen(buf)); if (written <= 0) mylog(LOG_ERROR, "Could not write to PID file"); close(fd); bip.listener = listen_new(conf_ip, conf_port, conf_css); if (!bip.listener || bip.listener->connected == CONN_ERROR) fatal("Could not create listening socket"); for (;;) { irc_main(&bip); sighup = 0; conf = fopen(confpath, "r"); if (!conf) fatal("%s config file not found", confpath); fireup(&bip, conf); fclose(conf); /* re-open to allow logfile rotate */ log_file_setup(); } return 1; } bip-0.9.3/src/utils/0000775000175000017500000000000014212410721011221 500000000000000bip-0.9.3/src/utils/base64.h0000664000175000017500000000060114212375475012413 00000000000000/* * Base64 encoding/decoding (RFC1341) * Copyright (c) 2005, Jouni Malinen * Copyright (c) 2022 Loïc Gomez * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #ifndef BASE64_H #define BASE64_H unsigned char *base64_encode(const unsigned char *src, size_t len, size_t *out_len); #endif /* BASE64_H */ bip-0.9.3/src/utils/base64.c0000664000175000017500000000430514212375475012413 00000000000000/* * Base64 encoding/decoding (RFC1341) * Copyright (c) 2005-2011, Jouni Malinen * Copyright (c) 2022 Loïc Gomez * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include #include #include #include "base64.h" static const unsigned char base64_table[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * base64_encode - Base64 encode * @src: Data to be encoded * @len: Length of the data to be encoded * @out_len: Pointer to output length variable, or %NULL if not used * Returns: Allocated buffer of out_len bytes of encoded data, * or %NULL on failure * * Caller is responsible for freeing the returned buffer. Returned buffer is * nul terminated to make it easier to use as a C string. The nul terminator is * not included in out_len. * * BIP change: remove line returns. */ unsigned char *base64_encode(const unsigned char *src, size_t len, size_t *out_len) { unsigned char *out, *pos; const unsigned char *end, *in; size_t olen; int line_len; olen = len * 4 / 3 + 4; /* 3-byte blocks to 4-byte */ olen += olen / 72; /* line feeds */ olen++; /* nul termination */ if (olen < len) return NULL; /* integer overflow */ out = malloc(olen); if (out == NULL) return NULL; end = src + len; in = src; pos = out; line_len = 0; while (end - in >= 3) { *pos++ = base64_table[in[0] >> 2]; *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)]; *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)]; *pos++ = base64_table[in[2] & 0x3f]; in += 3; line_len += 4; /* * BIP change: remove line returns. if (line_len >= 72) { *pos++ = '\n'; line_len = 0; } */ } if (end - in) { *pos++ = base64_table[in[0] >> 2]; if (end - in == 1) { *pos++ = base64_table[(in[0] & 0x03) << 4]; *pos++ = '='; } else { *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)]; *pos++ = base64_table[(in[1] & 0x0f) << 2]; } *pos++ = '='; line_len += 4; } /* * BIP change: remove line returns. if (line_len) *pos++ = '\n'; */ *pos = '\0'; if (out_len) *out_len = (size_t)(pos - out); return out; } bip-0.9.3/src/Makefile.am0000664000175000017500000000312514212375472012053 00000000000000noinst_LIBRARIES = libbip.a libbiplex.a libbiplex_a_SOURCES = \ conf.y lex.l # Not adding AM_CFLAGS here, because many debian flex releases generate code # that compares signed and unsigned integers. It looks like this issue is # fixed by flex 2.6.5 which is unreleased. libbiplex_a_CFLAGS = $(OPENSSL_CFLAGS) libbip_a_SOURCES = \ bip.c bip.h \ connection.c connection.h \ defaults.h \ irc.c irc.h \ line.c line.h \ log.c log.h \ md5.c md5.h \ path_util.c path_util.h \ tuple.h \ util.c util.h \ utils/base64.c utils/base64.h libbip_a_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bin_PROGRAMS = bip bipmkpw bip_SOURCES = bip_main.c bip_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bip_LDADD = libbip.a libbiplex.a ${OPENSSL_LIBS} bipmkpw_SOURCES = bipmkpw.c md5.c util.c bipmkpw_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bipmkpw_LDADD = libbip.a libbiplex.a $(OPENSSL_LIBS) AM_YFLAGS= -d BUILT_SOURCES = conf.c conf.h lex.c AM_CFLAGS=-Wall -Wextra -Werror \ -O2 \ -D_FORTIFY_SOURCE=2 \ -fstack-protector-strong -fstack-clash-protection \ -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code \ -Wpedantic -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-security -Wnull-dereference -Wstack-protector -Wtrampolines -Walloca -Wvla -Warray-bounds=2 -Wimplicit-fallthrough=3 -Wtraditional-conversion -Wshift-overflow=2 -Wcast-qual -Wstringop-overflow=4 -Wconversion -Warith-conversion -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wformat-signedness -Wshadow -Wstrict-overflow=4 -Wundef -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wstack-usage=1000000 -Wcast-align=strict bip-0.9.3/src/md5.h0000664000175000017500000000056114212375475010661 00000000000000#ifndef _MD5_H #define _MD5_H #ifndef uint8 #define uint8 unsigned char #endif #ifndef uint32 #define uint32 unsigned long int #endif typedef struct { uint32 total[2]; uint32 state[4]; uint8 buffer[64]; } md5_context; int chash_cmp(char *try, unsigned char *pass, unsigned int seed); unsigned char *chash_double(char *str, unsigned int seed); #endif /* md5.h */ bip-0.9.3/src/config.h.in0000644000175000017500000000151614212410717012032 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Use glibc backtrace on fatal() */ #undef HAVE_BACKTRACE /* Build SSL support */ #undef HAVE_LIBSSL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER bip-0.9.3/src/Makefile.in0000664000175000017500000014720214212410717012061 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ 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 = : bin_PROGRAMS = bip$(EXEEXT) bipmkpw$(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 $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libbip_a_AR = $(AR) $(ARFLAGS) libbip_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_libbip_a_OBJECTS = libbip_a-bip.$(OBJEXT) \ libbip_a-connection.$(OBJEXT) libbip_a-irc.$(OBJEXT) \ libbip_a-line.$(OBJEXT) libbip_a-log.$(OBJEXT) \ libbip_a-md5.$(OBJEXT) libbip_a-path_util.$(OBJEXT) \ libbip_a-util.$(OBJEXT) utils/libbip_a-base64.$(OBJEXT) libbip_a_OBJECTS = $(am_libbip_a_OBJECTS) libbiplex_a_AR = $(AR) $(ARFLAGS) libbiplex_a_LIBADD = am_libbiplex_a_OBJECTS = libbiplex_a-conf.$(OBJEXT) \ libbiplex_a-lex.$(OBJEXT) libbiplex_a_OBJECTS = $(am_libbiplex_a_OBJECTS) am_bip_OBJECTS = bip-bip_main.$(OBJEXT) bip_OBJECTS = $(am_bip_OBJECTS) am__DEPENDENCIES_1 = bip_DEPENDENCIES = libbip.a libbiplex.a $(am__DEPENDENCIES_1) bip_LINK = $(CCLD) $(bip_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_bipmkpw_OBJECTS = bipmkpw-bipmkpw.$(OBJEXT) bipmkpw-md5.$(OBJEXT) \ bipmkpw-util.$(OBJEXT) bipmkpw_OBJECTS = $(am_bipmkpw_OBJECTS) bipmkpw_DEPENDENCIES = libbip.a libbiplex.a $(am__DEPENDENCIES_1) bipmkpw_LINK = $(CCLD) $(bipmkpw_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/bip-bip_main.Po \ ./$(DEPDIR)/bipmkpw-bipmkpw.Po ./$(DEPDIR)/bipmkpw-md5.Po \ ./$(DEPDIR)/bipmkpw-util.Po ./$(DEPDIR)/libbip_a-bip.Po \ ./$(DEPDIR)/libbip_a-connection.Po ./$(DEPDIR)/libbip_a-irc.Po \ ./$(DEPDIR)/libbip_a-line.Po ./$(DEPDIR)/libbip_a-log.Po \ ./$(DEPDIR)/libbip_a-md5.Po ./$(DEPDIR)/libbip_a-path_util.Po \ ./$(DEPDIR)/libbip_a-util.Po ./$(DEPDIR)/libbiplex_a-conf.Po \ ./$(DEPDIR)/libbiplex_a-lex.Po \ utils/$(DEPDIR)/libbip_a-base64.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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 = @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || 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 @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || 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 = $(libbip_a_SOURCES) $(libbiplex_a_SOURCES) $(bip_SOURCES) \ $(bipmkpw_SOURCES) DIST_SOURCES = $(libbip_a_SOURCES) $(libbiplex_a_SOURCES) \ $(bip_SOURCES) $(bipmkpw_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/depcomp $(top_srcdir)/ylwrap conf.c conf.h lex.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ 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@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_AR = @ac_ct_AR@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libbip.a libbiplex.a libbiplex_a_SOURCES = \ conf.y lex.l # Not adding AM_CFLAGS here, because many debian flex releases generate code # that compares signed and unsigned integers. It looks like this issue is # fixed by flex 2.6.5 which is unreleased. libbiplex_a_CFLAGS = $(OPENSSL_CFLAGS) libbip_a_SOURCES = \ bip.c bip.h \ connection.c connection.h \ defaults.h \ irc.c irc.h \ line.c line.h \ log.c log.h \ md5.c md5.h \ path_util.c path_util.h \ tuple.h \ util.c util.h \ utils/base64.c utils/base64.h libbip_a_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bip_SOURCES = bip_main.c bip_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bip_LDADD = libbip.a libbiplex.a ${OPENSSL_LIBS} bipmkpw_SOURCES = bipmkpw.c md5.c util.c bipmkpw_CFLAGS = ${OPENSSL_CFLAGS} $(AM_CFLAGS) bipmkpw_LDADD = libbip.a libbiplex.a $(OPENSSL_LIBS) AM_YFLAGS = -d BUILT_SOURCES = conf.c conf.h lex.c AM_CFLAGS = -Wall -Wextra -Werror \ -O2 \ -D_FORTIFY_SOURCE=2 \ -fstack-protector-strong -fstack-clash-protection \ -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code \ -Wpedantic -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-security -Wnull-dereference -Wstack-protector -Wtrampolines -Walloca -Wvla -Warray-bounds=2 -Wimplicit-fallthrough=3 -Wtraditional-conversion -Wshift-overflow=2 -Wcast-qual -Wstringop-overflow=4 -Wconversion -Warith-conversion -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wformat-signedness -Wshadow -Wstrict-overflow=4 -Wundef -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wstack-usage=1000000 -Wcast-align=strict all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; 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)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) utils/$(am__dirstamp): @$(MKDIR_P) utils @: > utils/$(am__dirstamp) utils/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) utils/$(DEPDIR) @: > utils/$(DEPDIR)/$(am__dirstamp) utils/libbip_a-base64.$(OBJEXT): utils/$(am__dirstamp) \ utils/$(DEPDIR)/$(am__dirstamp) libbip.a: $(libbip_a_OBJECTS) $(libbip_a_DEPENDENCIES) $(EXTRA_libbip_a_DEPENDENCIES) $(AM_V_at)-rm -f libbip.a $(AM_V_AR)$(libbip_a_AR) libbip.a $(libbip_a_OBJECTS) $(libbip_a_LIBADD) $(AM_V_at)$(RANLIB) libbip.a conf.h: conf.c @if test ! -f $@; then rm -f conf.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) conf.c; else :; fi libbiplex.a: $(libbiplex_a_OBJECTS) $(libbiplex_a_DEPENDENCIES) $(EXTRA_libbiplex_a_DEPENDENCIES) $(AM_V_at)-rm -f libbiplex.a $(AM_V_AR)$(libbiplex_a_AR) libbiplex.a $(libbiplex_a_OBJECTS) $(libbiplex_a_LIBADD) $(AM_V_at)$(RANLIB) libbiplex.a bip$(EXEEXT): $(bip_OBJECTS) $(bip_DEPENDENCIES) $(EXTRA_bip_DEPENDENCIES) @rm -f bip$(EXEEXT) $(AM_V_CCLD)$(bip_LINK) $(bip_OBJECTS) $(bip_LDADD) $(LIBS) bipmkpw$(EXEEXT): $(bipmkpw_OBJECTS) $(bipmkpw_DEPENDENCIES) $(EXTRA_bipmkpw_DEPENDENCIES) @rm -f bipmkpw$(EXEEXT) $(AM_V_CCLD)$(bipmkpw_LINK) $(bipmkpw_OBJECTS) $(bipmkpw_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f utils/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bip-bip_main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bipmkpw-bipmkpw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bipmkpw-md5.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bipmkpw-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-bip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-connection.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-irc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-line.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-md5.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-path_util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbip_a-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbiplex_a-conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbiplex_a-lex.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@utils/$(DEPDIR)/libbip_a-base64.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libbip_a-bip.o: bip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-bip.o -MD -MP -MF $(DEPDIR)/libbip_a-bip.Tpo -c -o libbip_a-bip.o `test -f 'bip.c' || echo '$(srcdir)/'`bip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-bip.Tpo $(DEPDIR)/libbip_a-bip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bip.c' object='libbip_a-bip.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-bip.o `test -f 'bip.c' || echo '$(srcdir)/'`bip.c libbip_a-bip.obj: bip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-bip.obj -MD -MP -MF $(DEPDIR)/libbip_a-bip.Tpo -c -o libbip_a-bip.obj `if test -f 'bip.c'; then $(CYGPATH_W) 'bip.c'; else $(CYGPATH_W) '$(srcdir)/bip.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-bip.Tpo $(DEPDIR)/libbip_a-bip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bip.c' object='libbip_a-bip.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-bip.obj `if test -f 'bip.c'; then $(CYGPATH_W) 'bip.c'; else $(CYGPATH_W) '$(srcdir)/bip.c'; fi` libbip_a-connection.o: connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-connection.o -MD -MP -MF $(DEPDIR)/libbip_a-connection.Tpo -c -o libbip_a-connection.o `test -f 'connection.c' || echo '$(srcdir)/'`connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-connection.Tpo $(DEPDIR)/libbip_a-connection.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connection.c' object='libbip_a-connection.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-connection.o `test -f 'connection.c' || echo '$(srcdir)/'`connection.c libbip_a-connection.obj: connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-connection.obj -MD -MP -MF $(DEPDIR)/libbip_a-connection.Tpo -c -o libbip_a-connection.obj `if test -f 'connection.c'; then $(CYGPATH_W) 'connection.c'; else $(CYGPATH_W) '$(srcdir)/connection.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-connection.Tpo $(DEPDIR)/libbip_a-connection.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connection.c' object='libbip_a-connection.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-connection.obj `if test -f 'connection.c'; then $(CYGPATH_W) 'connection.c'; else $(CYGPATH_W) '$(srcdir)/connection.c'; fi` libbip_a-irc.o: irc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-irc.o -MD -MP -MF $(DEPDIR)/libbip_a-irc.Tpo -c -o libbip_a-irc.o `test -f 'irc.c' || echo '$(srcdir)/'`irc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-irc.Tpo $(DEPDIR)/libbip_a-irc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='irc.c' object='libbip_a-irc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-irc.o `test -f 'irc.c' || echo '$(srcdir)/'`irc.c libbip_a-irc.obj: irc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-irc.obj -MD -MP -MF $(DEPDIR)/libbip_a-irc.Tpo -c -o libbip_a-irc.obj `if test -f 'irc.c'; then $(CYGPATH_W) 'irc.c'; else $(CYGPATH_W) '$(srcdir)/irc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-irc.Tpo $(DEPDIR)/libbip_a-irc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='irc.c' object='libbip_a-irc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-irc.obj `if test -f 'irc.c'; then $(CYGPATH_W) 'irc.c'; else $(CYGPATH_W) '$(srcdir)/irc.c'; fi` libbip_a-line.o: line.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-line.o -MD -MP -MF $(DEPDIR)/libbip_a-line.Tpo -c -o libbip_a-line.o `test -f 'line.c' || echo '$(srcdir)/'`line.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-line.Tpo $(DEPDIR)/libbip_a-line.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='line.c' object='libbip_a-line.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-line.o `test -f 'line.c' || echo '$(srcdir)/'`line.c libbip_a-line.obj: line.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-line.obj -MD -MP -MF $(DEPDIR)/libbip_a-line.Tpo -c -o libbip_a-line.obj `if test -f 'line.c'; then $(CYGPATH_W) 'line.c'; else $(CYGPATH_W) '$(srcdir)/line.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-line.Tpo $(DEPDIR)/libbip_a-line.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='line.c' object='libbip_a-line.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-line.obj `if test -f 'line.c'; then $(CYGPATH_W) 'line.c'; else $(CYGPATH_W) '$(srcdir)/line.c'; fi` libbip_a-log.o: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-log.o -MD -MP -MF $(DEPDIR)/libbip_a-log.Tpo -c -o libbip_a-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-log.Tpo $(DEPDIR)/libbip_a-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libbip_a-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c libbip_a-log.obj: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-log.obj -MD -MP -MF $(DEPDIR)/libbip_a-log.Tpo -c -o libbip_a-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-log.Tpo $(DEPDIR)/libbip_a-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libbip_a-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` libbip_a-md5.o: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-md5.o -MD -MP -MF $(DEPDIR)/libbip_a-md5.Tpo -c -o libbip_a-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-md5.Tpo $(DEPDIR)/libbip_a-md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libbip_a-md5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c libbip_a-md5.obj: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-md5.obj -MD -MP -MF $(DEPDIR)/libbip_a-md5.Tpo -c -o libbip_a-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-md5.Tpo $(DEPDIR)/libbip_a-md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libbip_a-md5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi` libbip_a-path_util.o: path_util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-path_util.o -MD -MP -MF $(DEPDIR)/libbip_a-path_util.Tpo -c -o libbip_a-path_util.o `test -f 'path_util.c' || echo '$(srcdir)/'`path_util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-path_util.Tpo $(DEPDIR)/libbip_a-path_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='path_util.c' object='libbip_a-path_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-path_util.o `test -f 'path_util.c' || echo '$(srcdir)/'`path_util.c libbip_a-path_util.obj: path_util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-path_util.obj -MD -MP -MF $(DEPDIR)/libbip_a-path_util.Tpo -c -o libbip_a-path_util.obj `if test -f 'path_util.c'; then $(CYGPATH_W) 'path_util.c'; else $(CYGPATH_W) '$(srcdir)/path_util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-path_util.Tpo $(DEPDIR)/libbip_a-path_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='path_util.c' object='libbip_a-path_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-path_util.obj `if test -f 'path_util.c'; then $(CYGPATH_W) 'path_util.c'; else $(CYGPATH_W) '$(srcdir)/path_util.c'; fi` libbip_a-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-util.o -MD -MP -MF $(DEPDIR)/libbip_a-util.Tpo -c -o libbip_a-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-util.Tpo $(DEPDIR)/libbip_a-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libbip_a-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c libbip_a-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT libbip_a-util.obj -MD -MP -MF $(DEPDIR)/libbip_a-util.Tpo -c -o libbip_a-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbip_a-util.Tpo $(DEPDIR)/libbip_a-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libbip_a-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o libbip_a-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` utils/libbip_a-base64.o: utils/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT utils/libbip_a-base64.o -MD -MP -MF utils/$(DEPDIR)/libbip_a-base64.Tpo -c -o utils/libbip_a-base64.o `test -f 'utils/base64.c' || echo '$(srcdir)/'`utils/base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) utils/$(DEPDIR)/libbip_a-base64.Tpo utils/$(DEPDIR)/libbip_a-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils/base64.c' object='utils/libbip_a-base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o utils/libbip_a-base64.o `test -f 'utils/base64.c' || echo '$(srcdir)/'`utils/base64.c utils/libbip_a-base64.obj: utils/base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -MT utils/libbip_a-base64.obj -MD -MP -MF utils/$(DEPDIR)/libbip_a-base64.Tpo -c -o utils/libbip_a-base64.obj `if test -f 'utils/base64.c'; then $(CYGPATH_W) 'utils/base64.c'; else $(CYGPATH_W) '$(srcdir)/utils/base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) utils/$(DEPDIR)/libbip_a-base64.Tpo utils/$(DEPDIR)/libbip_a-base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils/base64.c' object='utils/libbip_a-base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbip_a_CFLAGS) $(CFLAGS) -c -o utils/libbip_a-base64.obj `if test -f 'utils/base64.c'; then $(CYGPATH_W) 'utils/base64.c'; else $(CYGPATH_W) '$(srcdir)/utils/base64.c'; fi` libbiplex_a-conf.o: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -MT libbiplex_a-conf.o -MD -MP -MF $(DEPDIR)/libbiplex_a-conf.Tpo -c -o libbiplex_a-conf.o `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbiplex_a-conf.Tpo $(DEPDIR)/libbiplex_a-conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='libbiplex_a-conf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -c -o libbiplex_a-conf.o `test -f 'conf.c' || echo '$(srcdir)/'`conf.c libbiplex_a-conf.obj: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -MT libbiplex_a-conf.obj -MD -MP -MF $(DEPDIR)/libbiplex_a-conf.Tpo -c -o libbiplex_a-conf.obj `if test -f 'conf.c'; then $(CYGPATH_W) 'conf.c'; else $(CYGPATH_W) '$(srcdir)/conf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbiplex_a-conf.Tpo $(DEPDIR)/libbiplex_a-conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='libbiplex_a-conf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -c -o libbiplex_a-conf.obj `if test -f 'conf.c'; then $(CYGPATH_W) 'conf.c'; else $(CYGPATH_W) '$(srcdir)/conf.c'; fi` libbiplex_a-lex.o: lex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -MT libbiplex_a-lex.o -MD -MP -MF $(DEPDIR)/libbiplex_a-lex.Tpo -c -o libbiplex_a-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbiplex_a-lex.Tpo $(DEPDIR)/libbiplex_a-lex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lex.c' object='libbiplex_a-lex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -c -o libbiplex_a-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c libbiplex_a-lex.obj: lex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -MT libbiplex_a-lex.obj -MD -MP -MF $(DEPDIR)/libbiplex_a-lex.Tpo -c -o libbiplex_a-lex.obj `if test -f 'lex.c'; then $(CYGPATH_W) 'lex.c'; else $(CYGPATH_W) '$(srcdir)/lex.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbiplex_a-lex.Tpo $(DEPDIR)/libbiplex_a-lex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lex.c' object='libbiplex_a-lex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbiplex_a_CFLAGS) $(CFLAGS) -c -o libbiplex_a-lex.obj `if test -f 'lex.c'; then $(CYGPATH_W) 'lex.c'; else $(CYGPATH_W) '$(srcdir)/lex.c'; fi` bip-bip_main.o: bip_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bip_CFLAGS) $(CFLAGS) -MT bip-bip_main.o -MD -MP -MF $(DEPDIR)/bip-bip_main.Tpo -c -o bip-bip_main.o `test -f 'bip_main.c' || echo '$(srcdir)/'`bip_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bip-bip_main.Tpo $(DEPDIR)/bip-bip_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bip_main.c' object='bip-bip_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bip_CFLAGS) $(CFLAGS) -c -o bip-bip_main.o `test -f 'bip_main.c' || echo '$(srcdir)/'`bip_main.c bip-bip_main.obj: bip_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bip_CFLAGS) $(CFLAGS) -MT bip-bip_main.obj -MD -MP -MF $(DEPDIR)/bip-bip_main.Tpo -c -o bip-bip_main.obj `if test -f 'bip_main.c'; then $(CYGPATH_W) 'bip_main.c'; else $(CYGPATH_W) '$(srcdir)/bip_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bip-bip_main.Tpo $(DEPDIR)/bip-bip_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bip_main.c' object='bip-bip_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bip_CFLAGS) $(CFLAGS) -c -o bip-bip_main.obj `if test -f 'bip_main.c'; then $(CYGPATH_W) 'bip_main.c'; else $(CYGPATH_W) '$(srcdir)/bip_main.c'; fi` bipmkpw-bipmkpw.o: bipmkpw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-bipmkpw.o -MD -MP -MF $(DEPDIR)/bipmkpw-bipmkpw.Tpo -c -o bipmkpw-bipmkpw.o `test -f 'bipmkpw.c' || echo '$(srcdir)/'`bipmkpw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-bipmkpw.Tpo $(DEPDIR)/bipmkpw-bipmkpw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bipmkpw.c' object='bipmkpw-bipmkpw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-bipmkpw.o `test -f 'bipmkpw.c' || echo '$(srcdir)/'`bipmkpw.c bipmkpw-bipmkpw.obj: bipmkpw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-bipmkpw.obj -MD -MP -MF $(DEPDIR)/bipmkpw-bipmkpw.Tpo -c -o bipmkpw-bipmkpw.obj `if test -f 'bipmkpw.c'; then $(CYGPATH_W) 'bipmkpw.c'; else $(CYGPATH_W) '$(srcdir)/bipmkpw.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-bipmkpw.Tpo $(DEPDIR)/bipmkpw-bipmkpw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bipmkpw.c' object='bipmkpw-bipmkpw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-bipmkpw.obj `if test -f 'bipmkpw.c'; then $(CYGPATH_W) 'bipmkpw.c'; else $(CYGPATH_W) '$(srcdir)/bipmkpw.c'; fi` bipmkpw-md5.o: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-md5.o -MD -MP -MF $(DEPDIR)/bipmkpw-md5.Tpo -c -o bipmkpw-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-md5.Tpo $(DEPDIR)/bipmkpw-md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='bipmkpw-md5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c bipmkpw-md5.obj: md5.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-md5.obj -MD -MP -MF $(DEPDIR)/bipmkpw-md5.Tpo -c -o bipmkpw-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-md5.Tpo $(DEPDIR)/bipmkpw-md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='bipmkpw-md5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi` bipmkpw-util.o: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-util.o -MD -MP -MF $(DEPDIR)/bipmkpw-util.Tpo -c -o bipmkpw-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-util.Tpo $(DEPDIR)/bipmkpw-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='bipmkpw-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c bipmkpw-util.obj: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -MT bipmkpw-util.obj -MD -MP -MF $(DEPDIR)/bipmkpw-util.Tpo -c -o bipmkpw-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bipmkpw-util.Tpo $(DEPDIR)/bipmkpw-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='bipmkpw-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bipmkpw_CFLAGS) $(CFLAGS) -c -o bipmkpw-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` .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) 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(LIBRARIES) config.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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) -rm -f utils/$(DEPDIR)/$(am__dirstamp) -rm -f utils/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f conf.c -rm -f conf.h -rm -f lex.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/bip-bip_main.Po -rm -f ./$(DEPDIR)/bipmkpw-bipmkpw.Po -rm -f ./$(DEPDIR)/bipmkpw-md5.Po -rm -f ./$(DEPDIR)/bipmkpw-util.Po -rm -f ./$(DEPDIR)/libbip_a-bip.Po -rm -f ./$(DEPDIR)/libbip_a-connection.Po -rm -f ./$(DEPDIR)/libbip_a-irc.Po -rm -f ./$(DEPDIR)/libbip_a-line.Po -rm -f ./$(DEPDIR)/libbip_a-log.Po -rm -f ./$(DEPDIR)/libbip_a-md5.Po -rm -f ./$(DEPDIR)/libbip_a-path_util.Po -rm -f ./$(DEPDIR)/libbip_a-util.Po -rm -f ./$(DEPDIR)/libbiplex_a-conf.Po -rm -f ./$(DEPDIR)/libbiplex_a-lex.Po -rm -f utils/$(DEPDIR)/libbip_a-base64.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS 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)/bip-bip_main.Po -rm -f ./$(DEPDIR)/bipmkpw-bipmkpw.Po -rm -f ./$(DEPDIR)/bipmkpw-md5.Po -rm -f ./$(DEPDIR)/bipmkpw-util.Po -rm -f ./$(DEPDIR)/libbip_a-bip.Po -rm -f ./$(DEPDIR)/libbip_a-connection.Po -rm -f ./$(DEPDIR)/libbip_a-irc.Po -rm -f ./$(DEPDIR)/libbip_a-line.Po -rm -f ./$(DEPDIR)/libbip_a-log.Po -rm -f ./$(DEPDIR)/libbip_a-md5.Po -rm -f ./$(DEPDIR)/libbip_a-path_util.Po -rm -f ./$(DEPDIR)/libbip_a-util.Po -rm -f ./$(DEPDIR)/libbiplex_a-conf.Po -rm -f ./$(DEPDIR)/libbiplex_a-lex.Po -rm -f utils/$(DEPDIR)/libbip_a-base64.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: uninstall-binPROGRAMS .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-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 uninstall-binPROGRAMS .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: bip-0.9.3/src/util.c0000664000175000017500000004071314212375475011147 00000000000000/* * $Id: util.c,v 1.60 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include "connection.h" #include "util.h" #include #include #include #include #include #include #include #include #include #include #include extern int conf_log_level; extern int conf_log_system; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" extern int errno; #pragma GCC diagnostic pop extern FILE *conf_global_log_file; void memory_fatal(void) { fflush(conf_global_log_file); #define OOMMSG "Out of memory.\n" fwrite(OOMMSG, (size_t)1, strlen(OOMMSG), conf_global_log_file); #undef OOMMSG fflush(conf_global_log_file); exit(28); } void *bip_malloc(size_t size) { void *r; assert(size < INT_MAX / 4); r = malloc(size); if (!r) memory_fatal(); return r; } void *bip_calloc(size_t nmemb, size_t size) { void *r = calloc(nmemb, size); if (!r) memory_fatal(); return r; } void *bip_realloc(void *ptr, size_t size) { void *r; assert(size < INT_MAX / 4); r = realloc(ptr, size); if (size > 0 && r == NULL) memory_fatal(); return r; } void bip_cfree(const void *ptr) { if (!ptr) return; // there's no other way to free a const pointer #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" free((void *)ptr); #pragma GCC diagnostic pop } char *bip_strdup(const char *str) { char *r = strdup(str); if (!r) memory_fatal(); return r; } char *bip_strcat_fit(size_t *remaining, char *str, const char *str2) { char *res; if (!remaining || !str || !str2) { mylog(LOG_DEBUGVERB, "bip_strcat_fit: got NULL pointer"); return NULL; } res = memccpy(str, str2, '\0', *remaining); if (!res) { mylog(LOG_DEBUGTOOMUCH, "bip_strcat_fit: memccpy() failed, remaining %lu", *remaining); return NULL; } res--; if (res < str) { mylog(LOG_DEBUG, "bip_strcat_fit: memccpy res < str"); return NULL; } (*remaining) -= (size_t)(res - str); return res; } #define STRCATF_BUF_MAXLEN 1024 char *bip_strcatf_fit(size_t *remaining, char *str, const char *fmt, ...) { va_list ap; char str2[STRCATF_BUF_MAXLEN + 1]; int written; char *res = NULL; if (!remaining || !str || !fmt) { mylog(LOG_DEBUGVERB, "bip_strcatf_fit: NULL pointer"); return NULL; } if (*remaining > STRCATF_BUF_MAXLEN) { mylog(LOG_ERROR, "bip_strcatf_fit: remaining " "is over STRCATF_BUF_MAXLEN"); } va_start(ap, fmt); str2[*remaining] = '\0'; written = vsnprintf(str2, *remaining, fmt, ap); if (written < 0) { mylog(LOG_ERROR, "bip_strcatf_fit: vsnprintf failed with: %s", strerror(errno)); return NULL; } if ((unsigned)written >= *remaining) { mylog(LOG_DEBUGVERB, "bip_strcatf_fit,vsnprintf: no space left"); goto end; } res = memccpy(str, str2, '\0', *remaining); if (!res) { mylog(LOG_DEBUGTOOMUCH, "bip_strcatf_fit: memccpy() failed, " "remaining %lu", *remaining); goto end; } if (res < str) { mylog(LOG_DEBUG, "bip_strcatf_fit: memccpy res < str"); goto end; } res--; (*remaining) -= (size_t)(res - str); end: va_end(ap); return res; } void bip_clock_gettime(clockid_t clockid, struct timespec *tp) { int err = clock_gettime(clockid, tp); if (err != 0) fatal("clock_gettime: %s", strerror(errno)); if (tp->tv_sec < 0 || tp->tv_nsec < 0) fatal("clock_gettime returned negative time"); } /* * ::= { | | } * ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}' */ int is_valid_nick(char *str) { char *tmp; if (!str || !isalpha(*str)) return 0; tmp = str; while (*tmp != '\0' && (isalnum(*tmp) || *tmp == '-' || *tmp == '[' || *tmp == ']' || *tmp == '\\' || *tmp == '`' || *tmp == '^' || *tmp == '{' || *tmp == '}' || *tmp == '|' || *tmp == '_')) tmp++; return (*tmp == '\0'); } int is_valid_username(char *str) { char *tmp; if (!str || *str == '\0' || *str == ' ' || *str == '\n' || *str == '\r') return 0; tmp = str; while (*tmp != '\0' && *tmp != ' ' && *tmp != '\0' && *tmp != '\r' && *tmp != '\n') tmp++; return (*tmp == '\0'); } char *timestamp(void) { static char ts[20]; time_t tv; struct tm *tm; time(&tv); tm = localtime(&tv); strftime(ts, (size_t)20, "%d-%m-%Y %H:%M:%S", tm); return ts; } char *hrtime(time_t s) { static char ts[20]; struct tm *tm; if (s == 0) return "never"; tm = localtime(&s); strftime(ts, (size_t)20, "%d-%m-%Y %H:%M:%S", tm); return ts; } #ifdef HAVE_LIBSSL char *checkmode2text(int v) { switch (v) { case SSL_CHECK_BASIC: return "basic"; case SSL_CHECK_CA: return "ca"; default: return "none"; } } #endif void _mylog(int level, char *fmt, va_list ap) { char *prefix; if (!conf_log_system) return; if (level > conf_log_level) return; switch (level) { case LOG_FATAL: prefix = "FATAL: "; break; case LOG_DEBUGVERB: prefix = "DEBUGVERB: "; break; case LOG_DEBUG: prefix = "DEBUG: "; break; case LOG_ERROR: prefix = "ERROR: "; break; case LOG_WARN: prefix = "WARNING: "; break; case LOG_INFO: prefix = ""; break; default: prefix = ""; break; } fprintf(conf_global_log_file, "%s %s", timestamp(), prefix); vfprintf(conf_global_log_file, fmt, ap); fprintf(conf_global_log_file, "\n"); #ifdef DEBUG fflush(conf_global_log_file); #endif } void mylog(int level, char *fmt, ...) { va_list ap; va_start(ap, fmt); _mylog(level, fmt, ap); va_end(ap); } #ifdef HAVE_BACKTRACE #include void dump_trace(void) { void *array[32]; int size; size = backtrace(array, 32); fflush(conf_global_log_file); backtrace_symbols_fd(array, size, fileno(conf_global_log_file)); } #endif extern char *conf_pid_file; void fatal(char *fmt, ...) { va_list ap; va_start(ap, fmt); _mylog(LOG_FATAL, fmt, ap); va_end(ap); #ifdef HAVE_BACKTRACE dump_trace(); #endif exit(200); } /* * list handling functions */ int list_ptr_cmp(const void *a, const void *b) { if (a == b) return 0; return -1; } void list_init(list_t *l, int (*cmp)(const void *, const void *)) { l->first = NULL; l->last = NULL; l->cmp = cmp; } list_t *list_new(int (*cmp)(const void *, const void *)) { list_t *l; l = bip_malloc(sizeof(list_t)); list_init(l, cmp); return l; } static struct list_item *list_item(void *ptr) { struct list_item *l; l = bip_malloc(sizeof(struct list_item)); l->ptr = ptr; l->next = NULL; l->prev = NULL; return l; } void list_add_first(list_t *list, void *ptr) { struct list_item *li; assert(list); if (!ptr) fatal("Cannot add NULL ptr to list."); li = list_item(ptr); if (!list->first) { list->first = list->last = li; return; } li->next = list->first; list->first = li; li->next->prev = li; } void list_add_first_uniq(list_t *list, void *ptr) { assert(list); assert_msg(ptr, "Cannot add NULL ptr to list."); if (list_get(list, ptr)) return; list_add_first(list, ptr); } void list_add_last(list_t *list, void *ptr) { struct list_item *li; assert(list); assert_msg(ptr, "Cannot add NULL ptr to list."); li = list_item(ptr); if (!list->first) { list->first = list->last = li; return; } li->prev = list->last; list->last = li; li->prev->next = li; } void *list_get_first(list_t *list) { assert(list); if (!list->first) return NULL; return list->first->ptr; } void *list_get_last(list_t *list) { assert(list); if (!list->last) return NULL; return list->last->ptr; } void *list_remove_first(list_t *list) { struct list_item *l; void *ptr; assert(list); ptr = list_get_first(list); if (!ptr) return NULL; l = list->first; list->first = list->first->next; if (list->first == NULL) list->last = NULL; free(l); return ptr; } void *list_remove_last(list_t *list) { struct list_item *l; void *ptr; assert(list); ptr = list_get_last(list); if (!ptr) return NULL; l = list->last; list->last = list->last->prev; if (list->last == NULL) list->first = NULL; free(l); return ptr; } void *list_remove_if_exists(list_t *list, const void *ptr) { list_iterator_t li; int debug = 0; void *ret = 0; assert(list); assert_msg(list->cmp, "list does not have a cmp function"); for (list_it_init(list, &li); list_it_item(&li); list_it_next(&li)) { if (list->cmp(list_it_item(&li), ptr) == 0) { if (debug == 1) fatal("%x appears twice in list\n", ptr); ret = list_it_remove(&li); debug = 1; } } if (debug) return ret; return NULL; } void *list_remove(list_t *list, const void *ptr) { void *ret; if (!(ret = list_remove_if_exists(list, ptr))) fatal("list_remove: item not found"); return ret; } void *list_get(list_t *list, const void *ptr) { struct list_item *it; assert_msg(list->cmp, "list_get: list does not have a cmp function"); for (it = list->first; it; it = it->next) { if (list->cmp(it->ptr, ptr) == 0) return it->ptr; } return NULL; } int list_is_empty(list_t *l) { assert(l); return (l->first ? 0 : 1); } void list_it_init(list_t *list, list_iterator_t *ti) { assert(list && ti); ti->list = list; ti->cur = list->first; ti->next = NULL; } void list_it_init_last(list_t *list, list_iterator_t *ti) { assert(list && ti); ti->list = list; ti->cur = list->last; ti->next = NULL; } void *list_it_remove(list_iterator_t *li) { assert(li); if (!li->cur) return NULL; if (li->cur->prev) li->cur->prev->next = li->cur->next; else li->list->first = li->cur->next; if (li->cur->next) li->cur->next->prev = li->cur->prev; else li->list->last = li->cur->prev; void *ptr = li->cur->ptr; struct list_item *item = li->cur; li->next = li->cur->next; li->cur = NULL; free(item); return ptr; } void list_free(list_t *t) { assert(t); assert(list_is_empty(t)); free(t); } void list_append(list_t *dest, list_t *src) { assert(dest && src); if (src->last == NULL) return; if (dest->first == NULL) { dest->first = src->first; dest->last = src->last; src->first = src->last = NULL; return; } src->first->prev = dest->last; dest->last->next = src->first; dest->last = src->last; src->first = src->last = NULL; } /* * Hash stuff */ struct hash_item { char *key; void *item; }; static int hash_item_nocase_cmp(const struct hash_item *a, const char *b) { return strcasecmp(a->key, b); } static int hash_item_cmp(struct hash_item *a, char *b) { return strcmp(a->key, b); } void hash_init(hash_t *h, int options) { int i; assert(h); memset(h, 0, sizeof(hash_t)); for (i = 0; i < 256; i++) { switch (options) { case HASH_NOCASE: list_init(&h->lists[i], (int (*)(const void *, const void *))hash_item_nocase_cmp); break; case HASH_DEFAULT: list_init(&h->lists[i], (int (*)(const void *, const void *))hash_item_cmp); break; default: fatal("wrong hash option %d", options); } } } void hash_clean(hash_t *h) { int i; struct hash_item *hi; assert(h); for (i = 0; i < 256; i++) { while ((hi = list_remove_first(&h->lists[i]))) { free(hi->key); free(hi); } } } void hash_free(hash_t *h) { assert(h); hash_clean(h); free(h); } hash_t *hash_new(int options) { hash_t *h; h = bip_malloc(sizeof(hash_t)); hash_init(h, options); return h; } /* Now we have a real hash, but we use only the last byte of it :p */ static unsigned char hash_func(const char *pkey) { char c; unsigned long hash = 5381; /* 5381 & 0xff makes more sense */ // toupper should not return negative values (only char compatible int) while ((c = *pkey++)) hash = ((hash << 5) + hash) ^ (long unsigned)toupper(c); return (unsigned char)hash; } void hash_insert(hash_t *hash, const char *key, void *ptr) { struct hash_item *it; assert(hash && key); if (hash_get(hash, key)) fatal("Element with key %s already in hash %x\n", key, hash); it = bip_malloc(sizeof(struct hash_item)); it->key = bip_strdup(key); it->item = ptr; list_add_first(&hash->lists[hash_func(key)], it); } int hash_includes(hash_t *hash, const char *key) { struct hash_item *hi; list_t *list; assert(hash && key); list = &hash->lists[hash_func(key)]; hi = list_get(list, key); return hi != NULL; } void *hash_get(hash_t *hash, const char *key) { struct hash_item *hi; list_t *list; assert(hash && key); list = &hash->lists[hash_func(key)]; hi = list_get(list, key); if (!hi) return NULL; return hi->item; } void *hash_remove_if_exists(hash_t *hash, const char *key) { assert(hash && key); if (hash_get(hash, key) == NULL) return NULL; return hash_remove(hash, key); } void *hash_remove(hash_t *hash, const char *key) { struct hash_item *it; void *ptr; assert(hash && key); it = (struct hash_item *)list_remove(&hash->lists[hash_func(key)], key); if (!it) return NULL; ptr = it->item; free(it->key); free(it); return ptr; } int hash_is_empty(hash_t *h) { int i; assert(h); for (i = 0; i < 256; i++) { if (!list_is_empty(&h->lists[i])) return 0; } return 1; } void hash_it_init(hash_t *h, hash_iterator_t *hi) { assert(h); memset(hi, 0, sizeof(hash_iterator_t)); hi->hash = h; while (hi->list < 256 && list_is_empty(&h->lists[hi->list])) hi->list++; if (hi->list < 256) list_it_init(&h->lists[hi->list], &hi->lit); } void hash_it_next(hash_iterator_t *hi) { assert(hi); list_it_next(&hi->lit); if (!list_it_item(&hi->lit)) { do { hi->list++; if (hi->list == 256) return; } while (list_is_empty(&hi->hash->lists[hi->list])); list_it_init(&hi->hash->lists[hi->list], &hi->lit); } } void *hash_it_item(hash_iterator_t *h) { struct hash_item *hi; assert(h); hi = list_it_item(&h->lit); if (!hi) return NULL; return hi->item; } const char *hash_it_key(hash_iterator_t *h) { struct hash_item *hi; assert(h); hi = list_it_item(&h->lit); if (!hi) return NULL; return hi->key; } void *hash_it_remove(hash_iterator_t *hi) { struct hash_item *hitem; void *ptr; assert(hi); hitem = list_it_remove(&hi->lit); ptr = hitem->item; free(hitem->key); free(hitem); return ptr; } void hash_dump(hash_t *h) { hash_iterator_t it; assert(h); for (hash_it_init(h, &it); hash_it_key(&it); hash_it_next(&it)) printf("%s => %p\n", hash_it_key(&it), hash_it_item(&it)); } list_t *hash_keys(hash_t *hash) { hash_iterator_t hi; list_t *ret; assert(hash); ret = list_new(NULL); for (hash_it_init(hash, &hi); hash_it_item(&hi); hash_it_next(&hi)) list_add_last(ret, bip_strdup(hash_it_key(&hi))); return ret; } void hash_rename_key(hash_t *h, const char *oldk, const char *newk) { assert(h && oldk && newk); if (strcmp(oldk, newk) == 0) return; hash_insert(h, newk, hash_remove(h, oldk)); } char *bip_strmaydup(char *s) { if (!s) return s; return bip_strdup(s); } void strucase(char *s) { while (*s) { *s = (char)toupper(*s); // toupper, safe to cast to char s++; } } int ischannel(char p) { return (p == '#' || p == '&' || p == '+' || p == '!'); } void array_init(array_t *a) { memset(a, 0, sizeof(array_t)); } array_t *array_new(void) { array_t *a; a = bip_malloc(sizeof(array_t)); array_init(a); return a; } void array_ensure(array_t *a, int index) { assert(a && index >= 0); if (array_includes(a, index)) return; a->elemv = bip_realloc(a->elemv, sizeof(void *) * (size_t)(index + 1)); // a->elemc should be lower than index + 1 memset(a->elemv + a->elemc, 0, sizeof(void *) * (size_t)(index + 1 - a->elemc)); a->elemc = index + 1; } const void *array_drop(array_t *a, int index) { int i; const void *ret; assert(a && array_includes(a, index)); ret = a->elemv[index]; for (i = index; i < array_count(a) - 1; i++) a->elemv[i] = a->elemv[i + 1]; a->elemc--; return ret; } array_t *array_extract(array_t *a, int index, int upto) { array_t *ret; int i; assert(a && array_includes(a, index)); if (upto == -1) upto = a->elemc; assert((index == 0 && upto == 0) || array_includes(a, upto - 1)); assert(index <= upto); ret = array_new(); if (index == upto) return ret; /* here we have index < upto */ array_ensure(ret, upto - index - 1); for (i = 0; i < ret->elemc; i++) ret->elemv[i] = a->elemv[i + index]; return ret; } void array_deinit(array_t *a) { assert(a); if (a->elemv) free(a->elemv); array_init(a); } void array_free(array_t *a) { assert(a); if (a->elemv) free(a->elemv); free(a); } bip-0.9.3/src/connection.h0000664000175000017500000000564214212375475012340 00000000000000/* * $Id: connection.h,v 1.40 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef CONNECTION_H #define CONNECTION_H #include "util.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBSSL #include #include #include #include #include #include #include #endif #define CONN_BUFFER_SIZE 8192 #define CONN_OK 1 #define CONN_TIMEOUT 2 #define CONN_ERROR 3 #define CONN_INPROGRESS 4 #define CONN_DISCONN 5 #define CONN_EXCEPT 6 #define CONN_NEW 7 #define CONN_NEED_SSLIZE 8 #define CONN_UNTRUSTED 9 #define WRITE_OK 0 #define WRITE_ERROR -1 #define WRITE_KEEP -2 #ifdef HAVE_LIBSSL #define SSL_CHECK_NONE (0) #define SSL_CHECK_BASIC (1) #define SSL_CHECK_CA (2) #endif struct connecting_data; typedef struct connection { int anti_flood; int ssl; unsigned long lasttoken; unsigned token; int handle; int connected; int listening; int client; time_t connect_time; time_t timeout; char *incoming; size_t incoming_end; list_t *outgoing; char *partial; list_t *incoming_lines; void *user_data; struct connecting_data *connecting_data; #ifdef HAVE_LIBSSL SSL_CTX *ssl_ctx_h; SSL *ssl_h; int ssl_check_mode; X509 *cert; #endif char *localip, *remoteip; uint16_t localport, remoteport; } connection_t; connection_t *connection_new(char *dsthostname, int dstport, char *srchostname, int srcport, int ssl, char *ssl_ciphers, int ssl_check_mode, char *ssl_check_store, char *ssl_client_certfile, time_t timeout); connection_t *listen_new(char *hostname, int port, int ssl); connection_t *accept_new(connection_t *cn); void connection_free(connection_t *cn); void connection_close(connection_t *cn); void write_line(connection_t *cn, char *line); void write_lines(connection_t *cn, list_t *lines); void write_line_fast(connection_t *cn, char *line); list_t *read_lines(connection_t *cn, int *error); list_t *wait_event(list_t *cn_list, time_t *msec, int *nc); int cn_is_connected(connection_t *cn); int cn_is_listening(connection_t *cn); uint16_t connection_localport(connection_t *cn); uint16_t connection_remoteport(connection_t *cn); char *connection_localip(connection_t *cn); char *connection_remoteip(connection_t *cn); #endif bip-0.9.3/src/lex.c0000664000175000017500000020542214212410721010742 00000000000000 #line 3 "lex.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 */ 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 73 #define YY_END_OF_BUFFER 74 /* 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[545] = { 0, 0, 0, 74, 72, 1, 2, 72, 72, 4, 71, 68, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 69, 70, 1, 0, 67, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 12, 0, 16, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 5, 13, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 32, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 23, 55, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 35, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 19, 0, 0, 0, 0, 57, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 62, 0, 0, 0, 0, 56, 46, 0, 40, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 8, 0, 0, 0, 0, 0, 53, 26, 0, 0, 31, 41, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 51, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 60, 0, 59, 65, 27, 28, 38, 0, 0, 61, 0, 42, 0, 0, 43, 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, 4, 1, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 8, 1, 9, 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, 10, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1, 27, 28, 29, 30, 31, 32, 1, 33, 1, 34, 1, 35, 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[36] = { 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 } ; static const flex_int16_t yy_base[547] = { 0, 0, 0, 555, 556, 34, 556, 549, 550, 545, 556, 556, 23, 28, 24, 536, 29, 525, 31, 534, 523, 41, 39, 40, 532, 53, 519, 517, 526, 516, 556, 556, 65, 537, 556, 538, 556, 533, 516, 506, 508, 525, 522, 508, 34, 522, 506, 512, 506, 513, 506, 505, 498, 501, 556, 491, 506, 499, 492, 507, 509, 504, 507, 488, 501, 487, 59, 485, 485, 481, 488, 479, 493, 482, 487, 486, 493, 478, 469, 480, 490, 476, 483, 473, 478, 480, 470, 482, 464, 469, 461, 464, 556, 478, 472, 454, 464, 471, 468, 469, 453, 470, 450, 456, 452, 454, 444, 447, 463, 457, 444, 442, 440, 444, 434, 446, 455, 442, 433, 434, 433, 436, 444, 434, 442, 426, 440, 429, 556, 426, 55, 556, 427, 556, 429, 426, 424, 416, 431, 556, 422, 421, 434, 428, 429, 60, 556, 556, 412, 425, 556, 411, 413, 413, 411, 407, 417, 418, 417, 404, 401, 416, 406, 395, 411, 400, 409, 398, 389, 394, 401, 390, 394, 392, 397, 404, 390, 61, 386, 397, 57, 396, 556, 400, 399, 389, 388, 389, 390, 394, 374, 380, 373, 390, 370, 369, 387, 386, 368, 363, 368, 52, 371, 376, 376, 365, 361, 365, 363, 375, 369, 372, 354, 556, 371, 365, 360, 362, 352, 364, 351, 361, 363, 362, 346, 360, 556, 556, 341, 349, 357, 342, 69, 342, 349, 334, 349, 332, 556, 336, 349, 343, 343, 341, 340, 325, 340, 324, 336, 324, 336, 333, 336, 327, 334, 334, 322, 87, 318, 317, 315, 320, 313, 62, 318, 317, 320, 323, 311, 556, 322, 316, 301, 313, 315, 556, 556, 556, 308, 308, 297, 297, 298, 301, 297, 290, 305, 305, 292, 556, 294, 296, 286, 288, 297, 292, 285, 287, 284, 293, 282, 286, 289, 275, 289, 274, 273, 270, 556, 279, 274, 286, 276, 265, 270, 281, 259, 266, 262, 278, 258, 264, 270, 263, 259, 250, 257, 263, 269, 250, 254, 247, 242, 264, 258, 556, 259, 260, 255, 248, 240, 236, 556, 242, 556, 254, 242, 253, 247, 237, 235, 248, 229, 65, 247, 227, 231, 232, 243, 241, 236, 240, 220, 233, 232, 227, 556, 216, 234, 222, 220, 214, 556, 211, 224, 209, 205, 221, 207, 207, 214, 205, 208, 556, 205, 200, 215, 217, 197, 200, 203, 190, 194, 196, 201, 190, 190, 204, 205, 87, 556, 191, 556, 204, 186, 197, 200, 556, 195, 556, 181, 194, 192, 192, 180, 189, 190, 188, 184, 181, 171, 556, 174, 174, 186, 166, 179, 171, 173, 173, 162, 178, 164, 177, 159, 152, 160, 160, 556, 556, 167, 154, 153, 160, 556, 556, 165, 556, 155, 161, 77, 164, 556, 153, 147, 162, 149, 147, 150, 155, 136, 156, 151, 556, 556, 149, 134, 136, 140, 127, 131, 133, 133, 133, 556, 137, 128, 143, 137, 138, 139, 138, 125, 556, 556, 131, 128, 556, 556, 116, 120, 133, 116, 126, 129, 113, 556, 117, 111, 114, 107, 115, 118, 121, 107, 101, 556, 102, 101, 112, 556, 115, 556, 108, 102, 96, 99, 106, 109, 91, 107, 94, 101, 556, 97, 80, 81, 93, 83, 556, 81, 556, 556, 556, 556, 556, 74, 78, 556, 77, 556, 70, 70, 556, 556, 61, 40 } ; static const flex_int16_t yy_def[547] = { 0, 544, 1, 544, 544, 544, 544, 545, 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 545, 544, 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 0, 544, 544 } ; static const flex_int16_t yy_nxt[592] = { 0, 4, 5, 6, 5, 7, 8, 9, 10, 11, 4, 12, 13, 14, 15, 4, 16, 4, 17, 18, 4, 19, 20, 4, 21, 22, 23, 24, 25, 26, 27, 28, 29, 4, 30, 31, 32, 38, 32, 42, 50, 35, 45, 46, 81, 39, 47, 43, 53, 48, 44, 63, 57, 40, 51, 41, 58, 54, 61, 64, 59, 82, 33, 62, 67, 65, 60, 32, 68, 32, 103, 165, 104, 180, 181, 215, 236, 166, 69, 216, 237, 70, 167, 168, 210, 265, 301, 211, 384, 302, 471, 212, 303, 385, 543, 542, 541, 266, 290, 540, 428, 429, 472, 539, 538, 537, 536, 535, 534, 291, 292, 293, 533, 532, 294, 430, 295, 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, 431, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 300, 299, 298, 297, 296, 289, 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 214, 213, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 164, 163, 146, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 80, 79, 78, 77, 76, 75, 37, 36, 34, 74, 73, 72, 71, 66, 56, 55, 52, 49, 37, 36, 34, 544, 3, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544 } ; static const flex_int16_t yy_chk[592] = { 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, 5, 12, 5, 13, 16, 546, 14, 14, 44, 12, 14, 13, 18, 14, 13, 23, 21, 12, 16, 12, 21, 18, 22, 23, 21, 44, 545, 22, 25, 23, 21, 32, 25, 32, 66, 130, 66, 145, 145, 180, 201, 130, 25, 180, 201, 25, 130, 130, 177, 232, 263, 177, 353, 263, 450, 177, 263, 353, 542, 541, 539, 232, 257, 537, 399, 399, 450, 536, 530, 528, 527, 526, 525, 257, 257, 257, 524, 522, 257, 399, 257, 521, 520, 519, 518, 517, 516, 515, 514, 513, 511, 509, 508, 507, 505, 504, 503, 502, 501, 500, 499, 498, 497, 495, 494, 493, 492, 491, 490, 489, 486, 485, 482, 481, 480, 479, 478, 477, 476, 475, 473, 472, 471, 470, 469, 468, 467, 466, 465, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 451, 449, 448, 446, 443, 442, 441, 440, 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 408, 406, 405, 404, 403, 401, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 371, 370, 369, 368, 367, 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 352, 351, 350, 349, 348, 347, 346, 345, 343, 341, 340, 339, 338, 337, 336, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 274, 273, 272, 271, 270, 268, 267, 266, 265, 264, 262, 261, 260, 259, 258, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 237, 236, 235, 234, 233, 231, 230, 229, 228, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 181, 179, 178, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 149, 148, 144, 143, 142, 141, 140, 138, 137, 136, 135, 134, 132, 129, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 53, 52, 51, 50, 49, 48, 47, 46, 45, 43, 42, 41, 40, 39, 38, 37, 35, 33, 29, 28, 27, 26, 24, 20, 19, 17, 15, 9, 8, 7, 3, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544 } ; 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 "lex.l" #define YY_NO_INPUT 1 #line 3 "lex.l" /* * $Id: lex.l,v 1.23 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip proproject * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "conf.h" int linec; #include "util.h" extern list_t *root_list; extern int yyparse(void); void free_conf(list_t*); int conf_error; typedef struct bip bip_t; extern bip_t *_bip; void conf_die(bip_t *, char *, ...); int yyerror(char *err) { conf_die(_bip, "Parse error '%s' near '%s', line %d", err, yytext, linec + 1); conf_error = 1; return 1; } list_t *parse_conf(FILE *file, int *err) { conf_error = 0; linec = 0; YY_BUFFER_STATE in = yy_create_buffer(file, YY_BUF_SIZE); yy_switch_to_buffer(in); yyparse(); yy_delete_buffer(in); *err = conf_error; return root_list; } #line 799 "lex.c" #line 800 "lex.c" #define INITIAL 0 #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 50 "lex.l" #line 1017 "lex.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 >= 545 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 556 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); 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 51 "lex.l" YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 52 "lex.l" { linec++; } YY_BREAK case 3: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 53 "lex.l" YY_BREAK case 4: YY_RULE_SETUP #line 54 "lex.l" { yylval.number = atoi(yytext); return LEX_INT; } YY_BREAK case 5: YY_RULE_SETUP #line 58 "lex.l" { yylval.number = strcmp(yytext, "true") == 0 ? 1 : 0; return LEX_BOOL; } YY_BREAK case 6: YY_RULE_SETUP #line 63 "lex.l" { return LEX_IP; } YY_BREAK case 7: YY_RULE_SETUP #line 64 "lex.l" { return LEX_PORT; } YY_BREAK case 8: YY_RULE_SETUP #line 65 "lex.l" { return LEX_CSS; } YY_BREAK case 9: YY_RULE_SETUP #line 66 "lex.l" { return LEX_SERVER; } YY_BREAK case 10: YY_RULE_SETUP #line 67 "lex.l" { return LEX_NETWORK; } YY_BREAK case 11: YY_RULE_SETUP #line 68 "lex.l" { return LEX_HOST; } YY_BREAK case 12: YY_RULE_SETUP #line 69 "lex.l" { return LEX_NAME; } YY_BREAK case 13: YY_RULE_SETUP #line 70 "lex.l" { return LEX_USER; } YY_BREAK case 14: YY_RULE_SETUP #line 71 "lex.l" { return LEX_ADMIN; } YY_BREAK case 15: YY_RULE_SETUP #line 72 "lex.l" { return LEX_CONNECTION; } YY_BREAK case 16: YY_RULE_SETUP #line 73 "lex.l" { return LEX_NICK; } YY_BREAK case 17: YY_RULE_SETUP #line 74 "lex.l" { return LEX_REALNAME; } YY_BREAK case 18: YY_RULE_SETUP #line 75 "lex.l" { return LEX_DEFAULT_NICK; } YY_BREAK case 19: YY_RULE_SETUP #line 76 "lex.l" { return LEX_DEFAULT_USER; } YY_BREAK case 20: YY_RULE_SETUP #line 77 "lex.l" { return LEX_DEFAULT_REALNAME; } YY_BREAK case 21: YY_RULE_SETUP #line 78 "lex.l" { return LEX_SOURCE_PORT; } YY_BREAK case 22: YY_RULE_SETUP #line 79 "lex.l" { return LEX_VHOST; } YY_BREAK case 23: YY_RULE_SETUP #line 80 "lex.l" { return LEX_PASSWORD; } YY_BREAK case 24: YY_RULE_SETUP #line 81 "lex.l" { return LEX_SSL; } YY_BREAK case 25: YY_RULE_SETUP #line 82 "lex.l" { return LEX_SSL_CHECK_MODE; } YY_BREAK case 26: YY_RULE_SETUP #line 83 "lex.l" { return LEX_SSL_CHECK_STORE; } YY_BREAK case 27: YY_RULE_SETUP #line 84 "lex.l" { return LEX_SSL_CLIENT_CERTFILE; } YY_BREAK case 28: YY_RULE_SETUP #line 85 "lex.l" { return LEX_DEFAULT_CIPHERS; } YY_BREAK case 29: YY_RULE_SETUP #line 86 "lex.l" { return LEX_CIPHERS; } YY_BREAK case 30: YY_RULE_SETUP #line 87 "lex.l" { return LEX_KEY; } YY_BREAK case 31: YY_RULE_SETUP #line 88 "lex.l" { return LEX_AUTOJOIN_ON_KICK; } YY_BREAK case 32: YY_RULE_SETUP #line 89 "lex.l" { return LEX_CHANNEL; } YY_BREAK case 33: YY_RULE_SETUP #line 90 "lex.l" { return LEX_LOG_LEVEL; } YY_BREAK case 34: YY_RULE_SETUP #line 91 "lex.l" { return LEX_LOG_ROOT; } YY_BREAK case 35: YY_RULE_SETUP #line 92 "lex.l" { return LEX_LOG_FORMAT; } YY_BREAK case 36: YY_RULE_SETUP #line 93 "lex.l" { return LEX_BACKLOG_LINES; } YY_BREAK case 37: YY_RULE_SETUP #line 94 "lex.l" { return LEX_BACKLOG_TIMESTAMP; } YY_BREAK case 38: YY_RULE_SETUP #line 95 "lex.l" { return LEX_BACKLOG_NO_TIMESTAMP; } YY_BREAK case 39: YY_RULE_SETUP #line 96 "lex.l" { return LEX_BACKLOG; } YY_BREAK case 40: YY_RULE_SETUP #line 97 "lex.l" { return LEX_ALWAYS_BACKLOG; } YY_BREAK case 41: YY_RULE_SETUP #line 98 "lex.l" { return LEX_BL_MSG_ONLY; } YY_BREAK case 42: YY_RULE_SETUP #line 99 "lex.l" { return LEX_BLRESET_ON_TALK; } YY_BREAK case 43: YY_RULE_SETUP #line 100 "lex.l" { return LEX_BLRESET_CONNECTION; } YY_BREAK case 44: YY_RULE_SETUP #line 101 "lex.l" { return LEX_BLRESET_ON_TALK; } YY_BREAK case 45: YY_RULE_SETUP #line 102 "lex.l" { return LEX_BL_MSG_ONLY; } YY_BREAK case 46: YY_RULE_SETUP #line 103 "lex.l" { return LEX_ALWAYS_BACKLOG; } YY_BREAK case 47: YY_RULE_SETUP #line 104 "lex.l" { return LEX_LOG; } YY_BREAK case 48: YY_RULE_SETUP #line 105 "lex.l" { return LEX_LOG_SYSTEM; } YY_BREAK case 49: YY_RULE_SETUP #line 106 "lex.l" { return LEX_LOG_SYNC_INTERVAL; } YY_BREAK case 50: YY_RULE_SETUP #line 107 "lex.l" { return LEX_FOLLOW_NICK; } YY_BREAK case 51: YY_RULE_SETUP #line 108 "lex.l" { return LEX_IGN_FIRST_NICK; } YY_BREAK case 52: YY_RULE_SETUP #line 109 "lex.l" { return LEX_AWAY_NICK; } YY_BREAK case 53: YY_RULE_SETUP #line 110 "lex.l" { return LEX_ON_CONNECT_SEND; } YY_BREAK case 54: YY_RULE_SETUP #line 111 "lex.l" { return LEX_NO_CLIENT_AWAY_MSG; } YY_BREAK case 55: YY_RULE_SETUP #line 112 "lex.l" { return LEX_PID_FILE; } YY_BREAK case 56: YY_RULE_SETUP #line 113 "lex.l" { return LEX_WRITE_OIDENTD; } YY_BREAK case 57: YY_RULE_SETUP #line 114 "lex.l" { return LEX_OIDENTD_FILE; } YY_BREAK case 58: YY_RULE_SETUP #line 115 "lex.l" { return LEX_BIP_USE_NOTICE; } YY_BREAK case 59: YY_RULE_SETUP #line 116 "lex.l" { return LEX_CSS_PEM; } YY_BREAK case 60: YY_RULE_SETUP #line 117 "lex.l" { return LEX_CSS_CIPHERS; } YY_BREAK case 61: YY_RULE_SETUP #line 118 "lex.l" { return LEX_DH_PARAM; } YY_BREAK case 62: YY_RULE_SETUP #line 119 "lex.l" { return LEX_SASL_USERNAME; } YY_BREAK case 63: YY_RULE_SETUP #line 120 "lex.l" { return LEX_SASL_PASSWORD; } YY_BREAK case 64: YY_RULE_SETUP #line 121 "lex.l" { return LEX_SASL_MECHANISM; } YY_BREAK case 65: YY_RULE_SETUP #line 122 "lex.l" { return LEX_IGNORE_CAPAB; } YY_BREAK case 66: YY_RULE_SETUP #line 123 "lex.l" { return LEX_RECONN_TIMER; } YY_BREAK case 67: /* rule 67 can match eol */ YY_RULE_SETUP #line 124 "lex.l" { size_t len = strlen(yytext) - 2; yylval.string = bip_malloc(len + 1); memcpy(yylval.string, yytext + 1, len); yylval.string[len] = 0; return LEX_STRING; } YY_BREAK case 68: YY_RULE_SETUP #line 131 "lex.l" { return LEX_EQ; } YY_BREAK case 69: YY_RULE_SETUP #line 132 "lex.l" { return LEX_LBRA; } YY_BREAK case 70: YY_RULE_SETUP #line 133 "lex.l" { return LEX_RBRA; } YY_BREAK case 71: YY_RULE_SETUP #line 134 "lex.l" { return LEX_SEMICOLON; } YY_BREAK case 72: YY_RULE_SETUP #line 135 "lex.l" { conf_die(_bip, "Parse error in config file line %d, unknown character '%s'", linec + 1, yytext); conf_error = 1; return LEX_BUNCH; } YY_BREAK case 73: YY_RULE_SETUP #line 137 "lex.l" ECHO; YY_BREAK #line 1458 "lex.c" case YY_STATE_EOF(INITIAL): 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_c_buf_p); 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 >= 545 ) 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 >= 545 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 544); 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 = file ? (isatty( fileno(file) ) > 0) : 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 137 "lex.l" bip-0.9.3/src/bipmkpw.c0000664000175000017500000000553014212375475011641 00000000000000/* * $Id$ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include #include #include #include #include #include #include #include "util.h" #include "md5.h" int conf_log_level; FILE *conf_global_log_file; int conf_log_system; void bipmkpw_fatal(char *msg, char *err) { fprintf(stderr, "%s: %s\n", msg, err); exit(1); } void readpass(char *buffer, int buflen) { int ttyfd = open("/dev/tty", O_RDWR); if (ttyfd == -1) bipmkpw_fatal("Unable to open tty", strerror(errno)); struct termios tt, ttback; memset(&ttback, 0, sizeof(ttback)); if (tcgetattr(ttyfd, &ttback) < 0) bipmkpw_fatal("tcgetattr failed", strerror(errno)); memcpy(&tt, &ttback, sizeof(ttback)); // unsigned conversion from ‘int’ to ‘tcflag_t’ {aka ‘unsigned int’} changes // value from ‘-11’ to ‘4294967285’ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" tt.c_lflag &= ~(ICANON | ECHO); #pragma GCC diagnostic pop if (tcsetattr(ttyfd, TCSANOW, &tt) < 0) bipmkpw_fatal("tcsetattr failed", strerror(errno)); if (!write(ttyfd, "Password: ", (size_t)10)) bipmkpw_fatal("tty write failed", strerror(errno)); int idx = 0; int valid = 1; while (idx < buflen) { ssize_t rbytes = read(ttyfd, buffer + idx, (size_t)1); if (rbytes <= 0) { break; } if (buffer[idx] == '\n') { buffer[idx] = 0; break; } else if (buffer[idx] == ' ') { valid = 0; } idx++; } if (!write(ttyfd, "\n", (size_t)1)) bipmkpw_fatal("tty write failed", strerror(errno)); tcsetattr(ttyfd, TCSANOW, &ttback); close(ttyfd); if (!valid) { fprintf(stderr, "Password cannot contain spaces.\n"); exit(1); } } int main(void) { int i; static char str[256]; unsigned char *md5; unsigned int seed; readpass(str, 256); str[255] = 0; // passing argument 1 of ‘srand’ with different width due to prototype // [-Werror=traditional-conversion] conversion from ‘time_t’ {aka ‘long int’} to // ‘unsigned int’ may change value [-Werror=conversion] We don't care. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" #pragma GCC diagnostic ignored "-Wconversion" // the time used to type the pass is entropy srand(time(NULL)); #pragma GCC diagnostic pop seed = (unsigned)rand(); // rand should be > 0 md5 = chash_double(str, seed); for (i = 0; i < 20; i++) printf("%02x", md5[i]); printf("\n"); free(md5); return 0; } bip-0.9.3/src/connection.c0000664000175000017500000013457714212375475012345 00000000000000/* * $Id: connection.c,v 1.98 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include #include #include "connection.h" #include "path_util.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" extern int errno; #pragma GCC diagnostic pop #ifdef HAVE_LIBSSL static int ssl_initialized = 0; static SSL_CTX *sslctx = NULL; static int ssl_cx_idx; extern FILE *conf_global_log_file; static BIO *errbio = NULL; extern char *conf_ssl_certfile; extern char *conf_biphome; extern char *conf_client_ciphers; extern char *conf_client_dh_file; static int SSLize(connection_t *cn, int *nc); static SSL_CTX *SSL_init_context(char *ciphers); /* SSH like trust management */ int link_add_untrusted(void *ls, X509 *cert); #endif static int cn_want_write(connection_t *cn); static int connection_timedout(connection_t *cn); static int socket_set_nonblock(int s); static void connection_connected(connection_t *c); struct connecting_data { struct addrinfo *dst; struct addrinfo *src; struct addrinfo *cur; }; static void connecting_data_free(struct connecting_data *t) { if (t->dst) freeaddrinfo(t->dst); if (t->src) freeaddrinfo(t->src); free(t); } void connection_close(connection_t *cn) { mylog(LOG_DEBUG, "Connection close asked. FD:%d (status: %d)", (long)cn->handle, cn->connected); if (cn->connected != CONN_DISCONN && cn->connected != CONN_ERROR) { cn->connected = CONN_DISCONN; if (close(cn->handle) == -1) mylog(LOG_WARN, "Error on socket close: %s", strerror(errno)); } } void connection_free(connection_t *cn) { connection_close(cn); if (cn->outgoing) { char *l; while ((l = list_remove_first(cn->outgoing))) free(l); list_free(cn->outgoing); } if (cn->incoming_lines) list_free(cn->incoming_lines); if (cn->incoming) free(cn->incoming); if (cn->connecting_data) connecting_data_free(cn->connecting_data); /* conn->user_data */ #ifdef HAVE_LIBSSL if (cn->ssl) { if (cn->cert) { X509_free(cn->cert); cn->cert = NULL; } if (cn->ssl_h) { SSL_shutdown(cn->ssl_h); SSL_free(cn->ssl_h); cn->ssl_h = NULL; } if (cn->ssl_ctx_h) { SSL_CTX_free(cn->ssl_ctx_h); cn->ssl_ctx_h = NULL; } } #endif if (cn->localip) { free(cn->localip); cn->localip = NULL; } if (cn->remoteip) { free(cn->remoteip); cn->remoteip = NULL; } free(cn); } static void connect_trynext(connection_t *cn) { struct addrinfo *cur; int err; if (!cn->connecting_data) fatal("called connect_trynext with a connection not " "connecting\n"); cur = cn->connecting_data->cur; for (cur = cn->connecting_data->cur; cur; cur = cur->ai_next) { if ((cn->handle = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol)) < 0) { mylog(LOG_WARN, "socket() : %s", strerror(errno)); continue; } if (cn->handle >= FD_SETSIZE) { mylog(LOG_WARN, "too many fd used, close socket %d", cn->handle); if (close(cn->handle) == -1) mylog(LOG_WARN, "Error on socket close: %s", strerror(errno)); cn->handle = -1; break; } socket_set_nonblock(cn->handle); if (cn->connecting_data->src) { /* local bind */ err = bind(cn->handle, cn->connecting_data->src->ai_addr, cn->connecting_data->src->ai_addrlen); if (err == -1) mylog(LOG_WARN, "bind() before connect: %s", strerror(errno)); } err = connect(cn->handle, cur->ai_addr, cur->ai_addrlen); if (err == -1 && errno == EINPROGRESS) { /* ok for now, see later */ /* next time try the next in the list */ cn->connecting_data->cur = cur->ai_next; cn->connect_time = time(NULL); cn->connected = CONN_INPROGRESS; return; } if (!err) { /* connect() successful */ connecting_data_free(cn->connecting_data); cn->connecting_data = NULL; cn->connected = cn->ssl ? CONN_NEED_SSLIZE : CONN_OK; connection_connected(cn); return; } /* connect() failed */ char ip[256]; mylog(LOG_WARN, "connect(%s) : %s", inet_ntop(cur->ai_family, cur->ai_addr, ip, 256), strerror(errno)); close(cn->handle); cn->handle = -1; } cn->connected = CONN_ERROR; connecting_data_free(cn->connecting_data); cn->connecting_data = NULL; mylog(LOG_ERROR, "connect() failed."); } #ifdef HAVE_LIBSSL static X509 *mySSL_get_cert(SSL *ssl) { X509 *cert; if (!ssl) { mylog(LOG_ERROR, "mySSL_get_cert() No SSL context"); return NULL; } cert = SSL_get_peer_certificate(ssl); if (cert == NULL) mylog(LOG_WARN, "mySSL_get_cert() SSL server supplied no " "certificate !"); return cert; } static int _write_socket_SSL(connection_t *cn, char *message) { int count; size_t size; size = sizeof(char) * strlen(message); // let's not ERR (SSL_write doesn't allow 0 len writes) if (size == 0) return WRITE_OK; // this will fail anyways if (size > INT_MAX) { mylog(LOG_ERROR, "Message too long in SSL write_socket"); return WRITE_ERROR; } if (!cn->client && cn->cert == NULL) { cn->cert = mySSL_get_cert(cn->ssl_h); if (cn->cert == NULL) { mylog(LOG_ERROR, "No certificate in SSL write_socket"); return WRITE_ERROR; } } count = SSL_write(cn->ssl_h, (const void *)message, (int)size); ERR_print_errors(errbio); if (count <= 0) { int err = SSL_get_error(cn->ssl_h, count); if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_ACCEPT) return WRITE_KEEP; if (cn_is_connected(cn)) { mylog(LOG_ERROR, "fd %d: Connection error", cn->handle); cn->connected = CONN_ERROR; } return WRITE_ERROR; } if (count != (int)size) { /* abnormal : openssl keeps writing until message is not fully * sent */ mylog(LOG_ERROR, "SSL_write wrote only %d while message length is %d", count, size); } mylog(LOG_DEBUGVERB, "%d/%d bytes sent", count, size); return WRITE_OK; } #if OPENSSL_VERSION_NUMBER < 0x10100000L #define X509_OBJECT_get0_X509(o) ((o)->data.x509) #define X509_STORE_CTX_get_by_subject(vs, type, name, ret) \ X509_STORE_get_by_subject(vs, type, name, ret) int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { // bip doesn't use q parameter assert(q == NULL); dh->p = p; dh->g = g; return 1; } X509_OBJECT *X509_OBJECT_new() { X509_OBJECT *ret = OPENSSL_malloc(sizeof(*ret)); if (ret != NULL) { memset(ret, 0, sizeof(*ret)); ret->type = X509_LU_FAIL; } else { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); } return ret; } void X509_OBJECT_free(X509_OBJECT *a) { if (a == NULL) return; switch (a->type) { default: break; case X509_LU_X509: X509_free(a->data.x509); break; case X509_LU_CRL: X509_CRL_free(a->data.crl); break; } OPENSSL_free(a); } #endif #endif static int _write_socket(connection_t *cn, char *message) { size_t size; size_t tcount = 0; ssize_t count; size = strlen(message); if (size == 0) return WRITE_OK; /* loop if we wrote some data but not everything, or if error is * EINTR */ do { count = write(cn->handle, ((const char *)message) + tcount, size - tcount); if (count > 0) { tcount += (size_t)count; if (tcount == size) return WRITE_OK; } } while (count > 0 || (count < 0 && errno == EINTR)); /* If we reach this point, we have a partial write */ assert(count != 0); /* if no fatal error, return WRITE_KEEP, which makes caller keep line * in its FIFO * * Shitty: we might have written a partial line, so we hack the line... * Callers of _write_socket muse provide a writable message */ // this might be the same #if EWOULDBLOCK == EAGAIN if (errno == EAGAIN || errno == EINPROGRESS) { #else if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINPROGRESS) { #endif memmove(message, message + tcount, size - tcount + 1); return WRITE_KEEP; } /* other errors, EPIPE or worse, close the connection, repport error */ if (cn_is_connected(cn)) { if (errno != EPIPE) mylog(LOG_INFO, "Broken socket: %s.", strerror(errno)); connection_close(cn); cn->connected = CONN_ERROR; } mylog(LOG_DEBUGVERB, "write: %d, %s", cn->handle, strerror(errno)); return WRITE_ERROR; } static int write_socket(connection_t *cn, char *line) { #ifdef HAVE_LIBSSL if (cn->ssl) return _write_socket_SSL(cn, line); else #endif return _write_socket(cn, line); } /* returns 1 if connection must be notified */ static int real_write_all(connection_t *cn) { int ret; char *line; if (cn == NULL) fatal("real_write_all: wrong arguments"); if (cn->partial) { line = cn->partial; cn->partial = NULL; } else { line = list_remove_first(cn->outgoing); } do { ret = write_socket(cn, line); switch (ret) { case WRITE_ERROR: /* we might as well free(line) here */ list_add_first(cn->outgoing, line); return 1; case WRITE_KEEP: /* interrupted or not ready */ assert(cn->partial == NULL); cn->partial = line; return 0; case WRITE_OK: free(line); break; default: fatal("internal error 6"); break; } if (cn->anti_flood) /* one line at a time */ break; } while ((line = list_remove_first(cn->outgoing))); return 0; } /* * May only be used when writing to the client or when sending * timing-sensitive data to the server (PONG, PING for lagtest, QUIT) * because fakelag is not enforced. */ void write_line_fast(connection_t *cn, char *line) { int r; char *nline = bip_strdup(line); if (cn->partial) { list_add_first(cn->outgoing, nline); } else { r = write_socket(cn, nline); switch (r) { case WRITE_KEEP: cn->partial = nline; break; case WRITE_ERROR: case WRITE_OK: free(nline); break; default: fatal("internal error 7"); break; } } } void write_lines(connection_t *cn, list_t *lines) { list_append(cn->outgoing, lines); if (cn_want_write(cn)) real_write_all(cn); } void write_line(connection_t *cn, char *line) { list_add_last(cn->outgoing, bip_strdup(line)); if (cn_want_write(cn)) real_write_all(cn); } list_t *read_lines(connection_t *cn, int *error) { list_t *ret = NULL; switch (cn->connected) { case CONN_TIMEOUT: case CONN_ERROR: case CONN_DISCONN: case CONN_EXCEPT: case CONN_UNTRUSTED: *error = 1; ret = NULL; break; case CONN_NEW: case CONN_INPROGRESS: case CONN_NEED_SSLIZE: *error = 0; ret = NULL; break; case CONN_OK: *error = 0; ret = cn->incoming_lines; cn->incoming_lines = NULL; break; default: fatal("internal error 8"); break; } return ret; } #ifdef HAVE_LIBSSL /* returns 1 if connection must be notified */ static int read_socket_SSL(connection_t *cn) { int count; size_t max; if (cn == NULL) return 0; if (cn->incoming_end >= CONN_BUFFER_SIZE) { mylog(LOG_ERROR, "read_socket_SSL: internal error"); return -1; } max = sizeof(char) * (CONN_BUFFER_SIZE - cn->incoming_end); if (max > INT_MAX) { mylog(LOG_ERROR, "read_socket_SSL: cannot read that much data"); return -1; } if (!cn->client && cn->cert == NULL) { cn->cert = mySSL_get_cert(cn->ssl_h); if (cn->cert == NULL) { mylog(LOG_ERROR, "No certificate in SSL read_socket"); return -1; } } count = SSL_read(cn->ssl_h, (void *)(cn->incoming + cn->incoming_end), (int)max); ERR_print_errors(errbio); if (count < 0) { int err = SSL_get_error(cn->ssl_h, count); if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_ACCEPT) return 0; if (cn_is_connected(cn)) { mylog(LOG_ERROR, "fd %d: Connection error", cn->handle); cn->connected = CONN_ERROR; } return 1; } else if (count == 0) { /* int err = SSL_get_error(cn->ssl_h,count); if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_ACCEPT) return 0;*/ if (cn_is_connected(cn)) { mylog(LOG_ERROR, "fd %d: Connection lost", cn->handle); connection_close(cn); } return 1; } else { cn->incoming_end += (size_t)count; return 0; } } #endif /* returns 1 if connection must be notified */ static int read_socket(connection_t *cn) { ssize_t count; size_t max; if (cn == NULL) return 0; if (cn->incoming_end >= CONN_BUFFER_SIZE) { mylog(LOG_ERROR, "read_socket: internal error"); return -1; } max = sizeof(char) * (CONN_BUFFER_SIZE - cn->incoming_end); count = read(cn->handle, cn->incoming + cn->incoming_end, max); if (count < 0) { if (errno == EAGAIN || errno == EINTR || errno == EINPROGRESS) return 0; if (cn_is_connected(cn)) { mylog(LOG_ERROR, "read(fd=%d): Connection error: %s", cn->handle, strerror(errno)); cn->connected = CONN_ERROR; } return 1; } else if (count == 0) { if (cn_is_connected(cn)) { mylog(LOG_ERROR, "read(fd=%d): Connection lost: %s", cn->handle, strerror(errno)); connection_close(cn); } return 1; } else { cn->incoming_end += (unsigned)count; return 0; } } static void data_find_lines(connection_t *cn) { size_t len = 0, lastlen = 0, ssz; char *p = cn->incoming; char *buf; for (;;) { while (len < cn->incoming_end && p[len] != '\n') len++; if (len >= cn->incoming_end || p[len] != '\n') break; ssz = len - lastlen; if (ssz >= 1) { if (p[len - 1] == '\r') ssz--; buf = bip_malloc(ssz + 1); memcpy(buf, p + lastlen, ssz); buf[ssz] = 0; list_add_last(cn->incoming_lines, buf); } len++; lastlen = len; } if (lastlen) { unsigned i; for (i = 0; i < cn->incoming_end - lastlen; i++) p[i] = p[i + lastlen]; cn->incoming_end -= lastlen; } } int cn_is_new(connection_t *cn) { switch (cn->connected) { case CONN_TIMEOUT: case CONN_ERROR: case CONN_DISCONN: case CONN_EXCEPT: case CONN_NEED_SSLIZE: case CONN_OK: case CONN_UNTRUSTED: return 0; case CONN_NEW: case CONN_INPROGRESS: return 1; default: fatal("internal error 9"); return 0; } } int cn_is_in_error(connection_t *cn) { switch (cn->connected) { case CONN_TIMEOUT: case CONN_ERROR: case CONN_DISCONN: case CONN_EXCEPT: case CONN_UNTRUSTED: return 1; case CONN_NEW: case CONN_INPROGRESS: case CONN_NEED_SSLIZE: case CONN_OK: return 0; default: fatal("internal error 10"); return 1; } } int cn_is_connected(connection_t *cn) { if (cn == NULL) fatal("cn_is_connected, wrong argument"); return (cn->connected == CONN_OK ? 1 : 0); } static int check_event_except(fd_set *fds, connection_t *cn) { if (!cn_is_connected(cn)) return 0; if (cn_is_in_error(cn)) { mylog(LOG_ERROR, "Error on fd %d (except, state %d)", cn->handle, cn->connected); return 1; } if (!FD_ISSET(cn->handle, fds)) return 0; mylog(LOG_DEBUGTOOMUCH, "fd %d is in exceptions list", cn->handle); cn->connected = CONN_EXCEPT; return 1; } static int check_event_read(fd_set *fds, connection_t *cn) { int ret; if (cn_is_in_error(cn)) { mylog(LOG_ERROR, "Error on fd %d (read, state %d)", cn->handle, cn->connected); return 1; } if (!FD_ISSET(cn->handle, fds)) return 0; mylog(LOG_DEBUGTOOMUCH, "Read positive on fd %d (state %d)", cn->handle, cn->connected); /* notify caller to make it check for a new client */ if (cn->listening) return 1; #ifdef HAVE_LIBSSL if (cn->ssl) ret = read_socket_SSL(cn); else #endif ret = read_socket(cn); if (ret) { mylog(LOG_ERROR, "Error while reading on fd %d", cn->handle); return 1; } if (!cn->incoming_lines) cn->incoming_lines = list_new(NULL); data_find_lines(cn); if (list_is_empty(cn->incoming_lines)) return 0; mylog(LOG_DEBUGTOOMUCH, "newlines on fd %d (state %d)", cn->handle, cn->connected); return 1; } static void connection_connected(connection_t *c) { if (c->localip) free(c->localip); c->localip = connection_localip(c); c->localport = connection_localport(c); if (c->remoteip) free(c->remoteip); c->remoteip = connection_remoteip(c); c->remoteport = connection_remoteport(c); } static int check_event_write(fd_set *fds, connection_t *cn, int *nc) { if (cn_is_in_error(cn)) { mylog(LOG_ERROR, "Error on fd %d (write, state %d)", cn->handle, cn->connected); return 1; } if (!FD_ISSET(cn->handle, fds)) { if (cn_is_connected(cn)) return 0; mylog(LOG_DEBUG, "New socket still not connected (%d)", cn->handle); /* check timeout (handles connect_trynext) */ return connection_timedout(cn); } mylog(LOG_DEBUGTOOMUCH, "Write positive on fd %d (state %d)", cn->handle, cn->connected); if (cn_is_new(cn)) { int err, err2; socklen_t errSize = sizeof(err); err2 = getsockopt(cn->handle, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize); if (err2 < 0) { mylog(LOG_ERROR, "fd:%d getsockopt error: %s", cn->handle, strerror(errno)); if (cn->connecting_data) { close(cn->handle); cn->handle = -1; connect_trynext(cn); } return (cn_is_new(cn) || cn->connected == CONN_NEED_SSLIZE) ? 0 : 1; } else if (err == EINPROGRESS || err == EALREADY) { mylog(LOG_DEBUG, "fd:%d Connection in progress...", cn->handle); return connection_timedout(cn); } else if (err == EISCONN || err == 0) { #ifdef HAVE_LIBSSL if (cn->ssl) { cn->connected = CONN_NEED_SSLIZE; return 0; } #endif cn->connected = CONN_OK; connection_connected(cn); *nc = 1; mylog(LOG_DEBUG, "fd:%d Connection established !", cn->handle); return 1; } else { mylog(LOG_WARN, "fd:%d Socket error: %s", cn->handle, strerror(err)); if (cn->connecting_data) { close(cn->handle); cn->handle = -1; connect_trynext(cn); } return (cn_is_new(cn) || cn->connected == CONN_NEED_SSLIZE) ? 0 : 1; } } #ifdef HAVE_LIBSSL if (cn->connected == CONN_NEED_SSLIZE) { if (SSLize(cn, nc)) return connection_timedout(cn); return 0; } #endif if (cn_is_connected(cn) && !list_is_empty(cn->outgoing)) real_write_all(cn); return 0; } /* starts empty */ /* capacity: 4 token */ #define TOKEN_MAX 4 /* token generation interval: 1200ms */ #define TOKEN_INTERVAL 1200 static int cn_want_write(connection_t *cn) { if (cn->anti_flood) { struct timespec tv; unsigned long now; /* fill the bucket */ /* we do not control when we are called */ /* now is the number of milliseconds since the Epoch, * cn->lasttoken is the number of milliseconds when we * last added a token to the bucket */ if (!clock_gettime(CLOCK_MONOTONIC, &tv)) { if (tv.tv_sec < 0 || tv.tv_nsec < 0) fatal("clock_gettime returned negative time"); now = (unsigned long)(tv.tv_sec * 1000 + tv.tv_nsec / 1000000); /* round now to TOKEN_INTERVAL multiple */ now -= now % TOKEN_INTERVAL; if (now < cn->lasttoken) { /* time shift or integer overflow */ cn->token = 1; cn->lasttoken = now; } else if (now > cn->lasttoken + TOKEN_INTERVAL) { cn->token += (unsigned)((now - cn->lasttoken) / TOKEN_INTERVAL); if (cn->token > TOKEN_MAX) cn->token = TOKEN_MAX; if (!cn->token) cn->token = 1; cn->lasttoken = now; } } else /* if clock_gettime() fails, juste ignore * antiflood */ cn->token = 1; /* use a token if needed and available */ if (!list_is_empty(cn->outgoing) && cn->token > 0) { cn->token--; return 1; } return 0; } return !list_is_empty(cn->outgoing); } list_t *wait_event(list_t *cn_list, time_t *msec, int *nc) { fd_set fds_read, fds_write, fds_except; int maxfd = -1, err; list_t *cn_newdata; list_iterator_t it; struct timeval tv; struct timespec btv, etv; *nc = 0; cn_newdata = list_new(list_ptr_cmp); FD_ZERO(&fds_read); FD_ZERO(&fds_write); FD_ZERO(&fds_except); for (list_it_init(cn_list, &it); list_it_item(&it); list_it_next(&it)) { connection_t *cn = list_it_item(&it); if (cn == NULL) fatal("wait_event: wrong argument"); mylog(LOG_DEBUGTOOMUCH, "I've seen socket %d !", cn->handle); if (cn->connected == CONN_DISCONN) { list_add_first_uniq(cn_newdata, cn); continue; } /* * This shouldn't happen ! just in case... */ if (cn->handle < 0 || cn->handle >= FD_SETSIZE) fatal("wait_event invalid socket %d", cn->handle); /* exceptions are OOB and disconnections */ FD_SET(cn->handle, &fds_except); maxfd = (cn->handle > maxfd ? cn->handle : maxfd); /* * if connected, we're looking for new incoming data * if new or lines waiting to be sent, we want * to know if it's ready or not. */ if (cn_is_connected(cn)) { FD_SET(cn->handle, &fds_read); mylog(LOG_DEBUGTOOMUCH, "Test read on fd %d %d:%d", cn->handle, cn->connected, cn_is_connected(cn)); } /* we NEVER want to check write on a listening socket */ if (cn->listening) continue; if (!cn_is_connected(cn) || cn_want_write(cn)) { FD_SET(cn->handle, &fds_write); mylog(LOG_DEBUGTOOMUCH, "Test write on fd %d %d:%d", cn->handle, cn->connected, cn_is_connected(cn)); } } /* if no connection is active, return the list... empty... */ if (maxfd == -1) { struct timespec req, rem; req.tv_sec = *msec * 1000; req.tv_nsec = 0; nanosleep(&req, &rem); *msec = rem.tv_sec; return cn_newdata; } tv.tv_sec = *msec / 1000; tv.tv_usec = (*msec % 1000) * 1000; mylog(LOG_DEBUGTOOMUCH, "msec: %d, sec: %d, usec: %d", *msec, tv.tv_sec, tv.tv_usec); bip_clock_gettime(CLOCK_MONOTONIC, &btv); err = select(maxfd + 1, &fds_read, &fds_write, &fds_except, &tv); if (err == 0) { /* select timed-out */ mylog(LOG_DEBUGTOOMUCH, "Select timed-out. irc.o timer !"); *msec = 0; return cn_newdata; } else { mylog(LOG_DEBUGTOOMUCH, "msec: %d, sec: %d, usec: %d", *msec, tv.tv_sec, tv.tv_usec); } bip_clock_gettime(CLOCK_MONOTONIC, &etv); if (etv.tv_sec < btv.tv_sec) mylog(LOG_ERROR, "Time rewinded ! not touching interval"); else { *msec -= (etv.tv_sec - btv.tv_sec) * 1000 + (etv.tv_nsec - btv.tv_nsec) / 1000000; /* in case we go forward in time */ if (*msec < 0) *msec = 0; } if (err < 0) { if (errno == EINTR) return cn_newdata; fatal("select(): %s", strerror(errno)); } for (list_it_init(cn_list, &it); list_it_item(&it); list_it_next(&it)) { connection_t *cn = list_it_item(&it); int toadd = 0; if (check_event_except(&fds_except, cn)) { mylog(LOG_DEBUGTOOMUCH, "Notify on FD %d (state %d)", cn->handle, cn->connected); list_add_first_uniq(cn_newdata, cn); continue; } if (check_event_write(&fds_write, cn, nc)) { if (cn_is_in_error(cn)) toadd = 1; } if (check_event_read(&fds_read, cn)) { mylog(LOG_DEBUGTOOMUCH, "Notify on FD %d (state %d)", cn->handle, cn->connected); toadd = 1; } if (toadd) list_add_first_uniq(cn_newdata, cn); } return cn_newdata; } static void create_socket(char *dsthostname, char *dstport, char *srchostname, char *srcport, connection_t *cn) { int err; struct connecting_data *cdata; struct addrinfo hint; memset(&hint, 0, sizeof(hint)); hint.ai_flags = AI_PASSIVE; hint.ai_family = PF_UNSPEC; hint.ai_socktype = SOCK_STREAM; hint.ai_protocol = 0; cn->connected = CONN_ERROR; cdata = (struct connecting_data *)bip_malloc( sizeof(struct connecting_data)); cdata->dst = cdata->src = cdata->cur = NULL; err = getaddrinfo(dsthostname, dstport, &hint, &cdata->dst); if (err) { mylog(LOG_ERROR, "getaddrinfo(%s): %s", dsthostname, gai_strerror(err)); connecting_data_free(cdata); cdata = NULL; return; } if (srchostname || srcport) { if ((err = getaddrinfo(srchostname, srcport, &hint, &cdata->src))) { /* not fatal ? maybe a config option is needed */ mylog(LOG_ERROR, "getaddrinfo(src): %s", gai_strerror(err)); cdata->src = NULL; } } cdata->cur = cdata->dst; cn->connecting_data = cdata; connect_trynext(cn); } static void create_listening_socket(char *hostname, char *port, connection_t *cn) { int multi_client = 1; int err; struct addrinfo *res, *cur; struct addrinfo hint = {.ai_flags = AI_PASSIVE, .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, .ai_protocol = 0, .ai_addrlen = 0, .ai_addr = 0, .ai_canonname = 0, .ai_next = 0}; cn->connected = CONN_ERROR; err = getaddrinfo(hostname, port, &hint, &res); if (err) { mylog(LOG_ERROR, "getaddrinfo(): %s", gai_strerror(err)); return; } for (cur = res; cur; cur = cur->ai_next) { if ((cn->handle = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol)) < 0) { mylog(LOG_WARN, "socket : %s", strerror(errno)); continue; } if (cn->handle >= FD_SETSIZE) { mylog(LOG_WARN, "too many fd used, close listening socket %d", cn->handle); if (close(cn->handle) == -1) mylog(LOG_WARN, "Error on socket close: %s", strerror(errno)); cn->handle = -1; break; } if (setsockopt(cn->handle, SOL_SOCKET, SO_REUSEADDR, (char *)&multi_client, (socklen_t)sizeof(multi_client)) < 0) { mylog(LOG_WARN, "setsockopt() : %s", strerror(errno)); close(cn->handle); cn->handle = -1; continue; } socket_set_nonblock(cn->handle); if (bind(cn->handle, cur->ai_addr, cur->ai_addrlen) < 0) { mylog(LOG_WARN, "bind() : %s", strerror(errno)); close(cn->handle); cn->handle = -1; continue; } err = listen(cn->handle, 256); if (err == -1) { mylog(LOG_WARN, "listen() : %s", strerror(errno)); close(cn->handle); cn->handle = -1; continue; } freeaddrinfo(res); cn->connected = CONN_OK; return; } freeaddrinfo(res); mylog(LOG_ERROR, "Unable to bind/listen"); cn->connected = CONN_ERROR; } static connection_t *connection_init(int anti_flood, int ssl, time_t timeout, int listen) { connection_t *conn; char *incoming; list_t *outgoing; conn = (connection_t *)bip_calloc(sizeof(connection_t), (size_t)1); incoming = (char *)bip_malloc((size_t)CONN_BUFFER_SIZE); outgoing = list_new(NULL); conn->anti_flood = anti_flood; conn->ssl = ssl; conn->lasttoken = 0; conn->token = TOKEN_MAX; conn->timeout = (listen ? 0 : timeout); conn->connect_time = 0; conn->incoming = incoming; conn->incoming_end = 0; conn->outgoing = outgoing; conn->incoming_lines = NULL; conn->user_data = NULL; conn->listening = listen; conn->handle = -1; conn->client = 0; conn->connecting_data = NULL; #ifdef HAVE_LIBSSL conn->ssl_ctx_h = NULL; conn->ssl_h = NULL; conn->cert = NULL; conn->ssl_check_mode = SSL_CHECK_NONE; #endif conn->connected = CONN_NEW; return conn; } #ifdef HAVE_LIBSSL static int ctx_set_dh(SSL_CTX *ctx) { /* Return ephemeral DH parameters. */ DH *dh = NULL; FILE *f; long ret; if ((f = fopen(conf_client_dh_file, "r")) == NULL) { mylog(LOG_ERROR, "Unable to open DH parameters (%s): %s", conf_client_dh_file, strerror(errno)); return 0; } dh = PEM_read_DHparams(f, NULL, NULL, NULL); fclose(f); if (dh == NULL) { mylog(LOG_ERROR, "Could not parse DH parameters from: %s", conf_client_dh_file); return 0; } // SSL crap: passing argument 3 of ‘SSL_CTX_ctrl’ with different width due to // prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" ret = SSL_CTX_set_tmp_dh(ctx, dh); #pragma GCC diagnostic pop DH_free(dh); if (ret != 1) { mylog(LOG_ERROR, "Unable to set DH parameters: %s", ERR_error_string(ERR_get_error(), NULL)); return 0; } return 1; } #endif connection_t *accept_new(connection_t *cn) { connection_t *conn; int err; socklen_t sa_len = sizeof(struct sockaddr); struct sockaddr sa; mylog(LOG_DEBUG, "Trying to accept new client on %d", cn->handle); err = accept(cn->handle, &sa, &sa_len); if (err < 0) { fatal("accept failed: %s", strerror(errno)); } if (err >= FD_SETSIZE) { mylog(LOG_WARN, "too many client connected, close %d", err); if (close(err) == -1) mylog(LOG_WARN, "Error on socket close: %s", strerror(errno)); return NULL; } socket_set_nonblock(err); conn = connection_init(cn->anti_flood, cn->ssl, cn->timeout, 0); conn->connect_time = time(NULL); conn->user_data = cn->user_data; conn->handle = err; conn->client = 1; #ifdef HAVE_LIBSSL if (cn->ssl) { if (!sslctx) { mylog(LOG_DEBUG, "No SSL context available for " "accepted connections. " "Initializing..."); if (!(sslctx = SSL_init_context(conf_client_ciphers))) { mylog(LOG_ERROR, "SSL context initialization " "failed"); connection_free(conn); return NULL; } if (!conf_client_dh_file) { // try with a default path but don't fail if it // doesn't exist conf_client_dh_file = default_path(conf_biphome, "dh.pem", "DH parameters"); struct stat st_buf; if (stat(conf_client_dh_file, &st_buf) != 0) { free(conf_client_dh_file); conf_client_dh_file = NULL; } } if (conf_client_dh_file) { if (!ctx_set_dh(sslctx)) { mylog(LOG_ERROR, "SSL Unable to load DH " "parameters"); connection_free(conn); return NULL; } } if (!SSL_CTX_use_certificate_chain_file( sslctx, conf_ssl_certfile)) mylog(LOG_WARN, "SSL: Unable to load " "certificate file"); if (!SSL_CTX_use_PrivateKey_file(sslctx, conf_ssl_certfile, SSL_FILETYPE_PEM)) mylog(LOG_WARN, "SSL: Unable to load key file"); } conn->ssl_h = SSL_new(sslctx); if (!conn->ssl_h) { connection_free(conn); SSL_CTX_free(sslctx); return NULL; } SSL_set_accept_state(conn->ssl_h); } #endif mylog(LOG_DEBUG, "New client on socket %d !", conn->handle); return conn; } connection_t *listen_new(char *hostname, int port, int ssl) { connection_t *conn; char portbuf[20]; /* TODO: allow litteral service name in the function interface */ if (snprintf(portbuf, (size_t)20, "%d", port) >= 20) portbuf[19] = '\0'; /* * SSL flag is only here to tell program to convert socket to SSL after * accept(). Listening socket will NOT be SSL */ conn = connection_init(0, ssl, (time_t)0, 1); create_listening_socket(hostname, portbuf, conn); return conn; } static connection_t *_connection_new(char *dsthostname, char *dstport, char *srchostname, char *srcport, time_t timeout) { connection_t *conn; conn = connection_init(1, 0, timeout, 0); create_socket(dsthostname, dstport, srchostname, srcport, conn); return conn; } #ifdef HAVE_LIBSSL static SSL_CTX *SSL_init_context(char *ciphers) { int fd, flags, rng; ssize_t ret; char buf[1025]; SSL_CTX *ctx; if (!ssl_initialized) { // SSL crap: passing argument 1 of ‘OPENSSL_init_ssl’ with different width due // to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" SSL_library_init(); #pragma GCC diagnostic pop SSL_load_error_strings(); errbio = BIO_new_fp(conf_global_log_file, BIO_NOCLOSE); ssl_cx_idx = SSL_get_ex_new_index((size_t)0, "bip connection_t", NULL, NULL, NULL); flags = O_RDONLY; flags |= O_NONBLOCK; fd = open("/dev/random", flags); if (fd < 0) { mylog(LOG_WARN, "SSL: /dev/random not ready, unable " "to manually seed PRNG."); goto prng_end; } do { ret = read(fd, buf, (size_t)1024); if (ret <= 0) { mylog(LOG_ERROR, "/dev/random: %s", strerror(errno)); goto prng_end; } mylog(LOG_DEBUG, "PRNG seeded with %d /dev/random " "bytes", ret); RAND_seed(buf, (int)ret); } while (!(rng = RAND_status())); prng_end: do { ret = close(fd); } while (ret != 0 && errno == EINTR); if (RAND_status()) { mylog(LOG_DEBUG, "SSL: PRNG is seeded !"); } else { mylog(LOG_WARN, "SSL: PRNG is not seeded enough"); mylog(LOG_WARN, " OpenSSL will use /dev/urandom if " "available."); } ssl_initialized = 1; } /* allocated by function */ if (!(ctx = SSL_CTX_new(SSLv23_method()))) { ERR_print_errors(errbio); return NULL; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" // SSL crap: passing argument 3 of ‘SSL_CTX_ctrl’ with different width // due to prototype SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH); SSL_CTX_set_timeout(ctx, (long)60); // SSL crap: passing argument 2 of ‘SSL_CTX_set_options’ with different // width due to prototype SSL_CTX_set_options(ctx, SSL_OP_ALL); #pragma GCC diagnostic pop if (ciphers && !SSL_CTX_set_cipher_list(ctx, ciphers)) { SSL_CTX_free(ctx); return NULL; } return ctx; } static int bip_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx) { char subject[256]; char issuer[256]; X509 *err_cert; int err, depth; SSL *ssl; connection_t *c; X509_OBJECT *xobj; int result; err_cert = X509_STORE_CTX_get_current_cert(ctx); err = X509_STORE_CTX_get_error(ctx); depth = X509_STORE_CTX_get_error_depth(ctx); /* Retrieve the SSL and connection_t objects from the store */ ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); c = SSL_get_ex_data(ssl, ssl_cx_idx); mylog(LOG_INFO, "SSL cert check: now at depth=%d", depth); X509_NAME_oneline(X509_get_subject_name(err_cert), subject, 256); X509_NAME_oneline(X509_get_issuer_name(err_cert), issuer, 256); mylog(LOG_INFO, "Subject: %s", subject); mylog(LOG_INFO, "Issuer: %s", issuer); result = preverify_ok; /* in basic mode (mode 1), accept a leaf certificate if we can find it * in the store */ if (c->ssl_check_mode == SSL_CHECK_BASIC && result == 0 && (err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY || err == X509_V_ERR_CERT_UNTRUSTED || err == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT || err == X509_V_ERR_CERT_HAS_EXPIRED || err == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN)) { if (!(xobj = X509_OBJECT_new())) { result = 0; } else { if (X509_STORE_CTX_get_by_subject( ctx, X509_LU_X509, X509_get_subject_name(err_cert), xobj) > 0 && !X509_cmp(X509_OBJECT_get0_X509(xobj), err_cert)) { if (err == X509_V_ERR_CERT_HAS_EXPIRED) mylog(LOG_INFO, "Basic mode; Accepting " "*expired* peer certificate " "found in store."); else mylog(LOG_INFO, "Basic mode; Accepting peer " "certificate found in store."); result = 1; err = X509_V_OK; X509_STORE_CTX_set_error(ctx, err); } else { mylog(LOG_INFO, "Basic mode; peer certificate NOT " "in store, rejecting it!"); err = X509_V_ERR_CERT_REJECTED; X509_STORE_CTX_set_error(ctx, err); link_add_untrusted(c->user_data, X509_dup(err_cert)); } X509_OBJECT_free(xobj); } } if (!result) { /* We have a verify error! Log it */ mylog(LOG_ERROR, "SSL cert check failed at depth=%d: %s (%d)", depth, X509_verify_cert_error_string((long)err), err); } return result; } static int SSLize(connection_t *cn, int *nc) { int err, err2; long errl; if (cn == NULL) return 1; if (cn->listening) { mylog(LOG_ERROR, "Can't use SSL with listening socket."); return 0; } if (!SSL_set_fd(cn->ssl_h, cn->handle)) { mylog(LOG_ERROR, "unable to associate FD to SSL structure"); cn->connected = CONN_ERROR; return 1; } if (cn->client) err = SSL_accept(cn->ssl_h); else err = SSL_connect(cn->ssl_h); err2 = SSL_get_error(cn->ssl_h, err); ERR_print_errors(errbio); if (err2 == SSL_ERROR_NONE) { const SSL_CIPHER *cipher; char buf[128]; size_t len; cipher = SSL_get_current_cipher(cn->ssl_h); SSL_CIPHER_description(cipher, buf, 128); len = strlen(buf); if (len > 0) buf[len - 1] = '\0'; mylog(LOG_DEBUG, "Negotiated ciphers: %s", buf); cn->connected = CONN_OK; connection_connected(cn); *nc = 1; return 0; } switch (cn->ssl_check_mode) { case SSL_CHECK_NONE: break; case SSL_CHECK_BASIC: if ((errl = SSL_get_verify_result(cn->ssl_h)) != X509_V_OK) { mylog(LOG_ERROR, "Certificate check failed: %s (%ld)!", X509_verify_cert_error_string(errl), errl); cn->connected = CONN_UNTRUSTED; return 1; } break; case SSL_CHECK_CA: if ((errl = SSL_get_verify_result(cn->ssl_h)) != X509_V_OK) { mylog(LOG_ERROR, "Certificate check failed: %s (%ld)!", X509_verify_cert_error_string(errl), errl); cn->connected = CONN_UNTRUSTED; return 1; } break; default: mylog(LOG_ERROR, "Unknown ssl_check_mode (%d)!", cn->ssl_check_mode); return 1; } if (err2 == SSL_ERROR_SYSCALL) { mylog(LOG_ERROR, "Error with socket during ssl handshake."); connection_close(cn); cn->connected = CONN_ERROR; return 1; } /* From now on, we are on error, thus we return 1 to check timeout */ if (err2 == SSL_ERROR_ZERO_RETURN || err2 == SSL_ERROR_SSL) { mylog(LOG_ERROR, "Error in SSL handshake."); connection_close(cn); cn->connected = CONN_ERROR; return 1; } /* Here are unhandled errors/resource waiting. Timeout must be * checked but connection may still be valid */ return 1; } static connection_t *_connection_new_SSL(char *dsthostname, char *dstport, char *srchostname, char *srcport, char *ciphers, int check_mode, char *check_store, char *ssl_client_certfile, time_t timeout) { connection_t *conn; conn = connection_init(1, 1, timeout, 0); if (!(conn->ssl_ctx_h = SSL_init_context(ciphers))) { mylog(LOG_ERROR, "SSL context initialization failed"); return conn; } conn->cert = NULL; conn->ssl_check_mode = check_mode; switch (conn->ssl_check_mode) { struct stat st_buf; case SSL_CHECK_NONE: break; case SSL_CHECK_BASIC: if (!SSL_CTX_load_verify_locations(conn->ssl_ctx_h, check_store, NULL)) { mylog(LOG_ERROR, "Can't assign check store to " "SSL connection! Proceeding without!"); } break; case SSL_CHECK_CA: if (!check_store) { if (SSL_CTX_set_default_verify_paths(conn->ssl_ctx_h)) { mylog(LOG_INFO, "No SSL certificate check store configured. " "Default store will be used."); break; } else { mylog(LOG_ERROR, "No SSL certificate check store configured " "and cannot use default store!"); return conn; } } // Check if check_store is a file or directory if (stat(check_store, &st_buf) == 0) { if (st_buf.st_mode & S_IFDIR) { if (!SSL_CTX_load_verify_locations( conn->ssl_ctx_h, NULL, check_store)) { mylog(LOG_ERROR, "Can't assign check store to " "SSL connection!"); return conn; } break; } if (st_buf.st_mode & S_IFREG) { if (!SSL_CTX_load_verify_locations( conn->ssl_ctx_h, check_store, NULL)) { mylog(LOG_ERROR, "Can't assign check store to " "SSL connection!"); return conn; } break; } mylog(LOG_ERROR, "Specified SSL certificate check store is neither " "a file nor a directory."); return conn; } mylog(LOG_ERROR, "Can't open SSL certificate check store! Check path " "and permissions."); return conn; default: fatal("Unknown SSL cert check mode."); } switch (conn->ssl_check_mode) { case SSL_CHECK_NONE: SSL_CTX_set_verify(conn->ssl_ctx_h, SSL_VERIFY_NONE, NULL); break; case SSL_CHECK_BASIC: SSL_CTX_set_verify(conn->ssl_ctx_h, SSL_VERIFY_PEER, bip_ssl_verify_callback); /* SSL_CTX_set_verify_depth(conn->ssl_ctx_h, 0); */ break; case SSL_CHECK_CA: SSL_CTX_set_verify(conn->ssl_ctx_h, SSL_VERIFY_PEER, bip_ssl_verify_callback); break; default: fatal("Unknown SSL cert check mode."); } if (ssl_client_certfile) { if (!SSL_CTX_use_certificate_chain_file(conn->ssl_ctx_h, ssl_client_certfile)) mylog(LOG_WARN, "SSL: Unable to load certificate file"); else if (!SSL_CTX_use_PrivateKey_file(conn->ssl_ctx_h, ssl_client_certfile, SSL_FILETYPE_PEM)) mylog(LOG_WARN, "SSL: Unable to load key file"); else mylog(LOG_INFO, "SSL: using %s pem file as client SSL " "certificate", ssl_client_certfile); } conn->ssl_h = SSL_new(conn->ssl_ctx_h); if (conn->ssl_h == NULL) { mylog(LOG_ERROR, "Unable to allocate SSL structures"); return conn; } /* ys: useless as long as we have a context by connection if (sslctx->session_cache_head) if (!SSL_set_session(conn->ssl_h, sslctx->session_cache_head)) mylog(LOG_ERROR, "unable to set SSL session id to" " most recent used"); */ SSL_set_connect_state(conn->ssl_h); /* Put our connection_t in the SSL object for the verify callback */ SSL_set_ex_data(conn->ssl_h, ssl_cx_idx, conn); create_socket(dsthostname, dstport, srchostname, srcport, conn); return conn; } #endif connection_t *connection_new(char *dsthostname, int dstport, char *srchostname, int srcport, int ssl, char *ssl_ciphers, int ssl_check_mode, char *ssl_check_store, char *ssl_client_certfile, time_t timeout) { char dstportbuf[20], srcportbuf[20], *tmp; #ifndef HAVE_LIBSSL (void)ssl; (void)ssl_ciphers; (void)ssl_check_mode; (void)ssl_check_store; (void)ssl_client_certfile; #endif /* TODO: allow litteral service name in the function interface */ if (snprintf(dstportbuf, (size_t)20, "%d", dstport) >= 20) dstportbuf[19] = '\0'; if (srcport) { if (snprintf(srcportbuf, (size_t)20, "%d", srcport) >= 20) srcportbuf[19] = '\0'; tmp = srcportbuf; } else tmp = NULL; #ifdef HAVE_LIBSSL if (ssl) return _connection_new_SSL(dsthostname, dstportbuf, srchostname, tmp, ssl_ciphers, ssl_check_mode, ssl_check_store, ssl_client_certfile, timeout); else #endif return _connection_new(dsthostname, dstportbuf, srchostname, tmp, timeout); } int cn_is_listening(connection_t *cn) { if (cn == NULL) return 0; else return cn->listening; } /* returns 1 if connection must be notified */ static int connection_timedout(connection_t *cn) { if (cn_is_connected(cn) || !cn->timeout) return 0; if (!cn->connecting_data) fatal("connection_timedout called with no connecting_data!\n"); if (time(NULL) - cn->connect_time > cn->timeout) { /* connect() completion timed out */ close(cn->handle); cn->handle = -1; connect_trynext(cn); if (!cn_is_new(cn) && cn->connected != CONN_NEED_SSLIZE) return 1; } return 0; } static int socket_set_nonblock(int s) { int flags; if ((flags = fcntl(s, F_GETFL, 0)) < 0) { mylog(LOG_ERROR, "Cannot set socket %d to non blocking : %s", s, strerror(errno)); return 0; } if (fcntl(s, F_SETFL, flags | O_NONBLOCK) < 0) { mylog(LOG_ERROR, "Cannot set socket %d to non blocking : %s", s, strerror(errno)); return 0; } return 1; } #ifdef TEST int main(int argc, char *argv[]) { connection_t *conn, *conn2; int s, cont = 1; if (argc != 3) { fprintf(stderr, "Usage: %s host port\n", argv[0]); exit(1); } conn = connection_init(0, 0, (time_t)0, 1); conn->connect_time = time(NULL); create_listening_socket(argv[1], argv[2], &conn); if (s == -1) { mylog(LOG_ERROR, "socket() : %s", strerror(errno)); exit(1); } mylog(LOG_DEBUG, "Socket number %d", s); while (cont) { conn2 = accept_new(conn); if (conn2) { mylog(LOG_DEBUG, "New client"); cont = 0; } sleep(1); } while (1) { int ret = read_socket(conn2); mylog(LOG_DEBUGTOOMUCH, "READ: %d %*s", ret, conn2->incoming, conn2->incoming_end); conn2->incoming_end = 0; sleep(1); } return 0; } #endif uint16_t connection_localport(connection_t *cn) { struct sockaddr_in addr; int err; socklen_t addrlen; if (cn->handle <= 0) return 0; addrlen = sizeof(addr); err = getsockname(cn->handle, (struct sockaddr *)&addr, &addrlen); if (err != 0) { mylog(LOG_ERROR, "in getsockname(%d): %s", cn->handle, strerror(errno)); return 0; } // ntohs() expects uint16_t, while sockaddr_in.sin_port is an in_port_t... #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" return ntohs(addr.sin_port); #pragma GCC diagnostic pop } uint16_t connection_remoteport(connection_t *cn) { struct sockaddr_in addr; int err; socklen_t addrlen; if (cn->handle <= 0) return 0; addrlen = sizeof(addr); err = getpeername(cn->handle, (struct sockaddr *)&addr, &addrlen); if (err != 0) { mylog(LOG_ERROR, "in getpeername(%d): %s", cn->handle, strerror(errno)); return 0; } // ntohs() expects uint16_t, while sockaddr_in.sin_port is an in_port_t... #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" return ntohs(addr.sin_port); #pragma GCC diagnostic pop } static char *socket_ip(int fd, int remote) { struct sockaddr addr; struct sockaddr_in addr4; struct sockaddr_in6 addr6; socklen_t addrlen; socklen_t addrlen4; socklen_t addrlen6; int err; char *ip; const char *ret; if (fd <= 0) return NULL; addrlen = sizeof(addr); /* getsockname every time to get IP version */ err = getsockname(fd, (struct sockaddr *)&addr, &addrlen); if (err != 0) { mylog(LOG_ERROR, "in getsockname(%d): %s", fd, strerror(errno)); return NULL; } ip = bip_malloc((size_t)65); switch (addr.sa_family) { case AF_INET: addrlen4 = sizeof(addr4); if (remote) { err = getpeername(fd, (struct sockaddr *)&addr4, &addrlen4); if (err != 0) { mylog(LOG_ERROR, "in getpeername(%d): %s", fd, strerror(errno)); free(ip); return NULL; } } else { err = getsockname(fd, (struct sockaddr *)&addr4, &addrlen4); if (err != 0) { mylog(LOG_ERROR, "in getsockname(%d): %s", fd, strerror(errno)); free(ip); return NULL; } } ret = inet_ntop(AF_INET, &(addr4.sin_addr.s_addr), ip, 64); if (ret == NULL) { mylog(LOG_ERROR, "in inet_ntop: %s", strerror(errno)); free(ip); return NULL; } break; case AF_INET6: addrlen6 = sizeof(addr6); if (remote) { err = getpeername(fd, (struct sockaddr *)&addr6, &addrlen6); if (err != 0) { mylog(LOG_ERROR, "in getpeername(%d): %s", fd, strerror(errno)); free(ip); return NULL; } } else { err = getsockname(fd, (struct sockaddr *)&addr6, &addrlen6); if (err != 0) { mylog(LOG_ERROR, "in getsockname(%d): %s", fd, strerror(errno)); free(ip); return NULL; } } ret = inet_ntop(AF_INET6, &(addr6.sin6_addr), ip, 64); if (ret == NULL) { mylog(LOG_ERROR, "in inet_ntop: %s", strerror(errno)); free(ip); return NULL; } break; default: mylog(LOG_ERROR, "Unknown socket family, that's bad."); free(ip); return NULL; } return ip; } char *connection_localip(connection_t *cn) { if (cn->handle <= 0) return NULL; return socket_ip(cn->handle, 0); } char *connection_remoteip(connection_t *cn) { if (cn->handle <= 0) return NULL; return socket_ip(cn->handle, 1); } bip-0.9.3/src/bip.h0000664000175000017500000000146212442320231010726 00000000000000/* * $Id: bip.h,v 1.6 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004 2005 Arnaud Cornet and Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef BIP_H #define BIP_H #ifdef HAVE_LIBSSL int adm_trust(struct link_client *ic, struct line *line); #endif int adm_bip(bip_t *bip, struct link_client *ic, struct line *line, int privmsg); int ssl_check_trust(struct link_client *ic); void adm_blreset(struct link_client *ic); void bip_notify(struct link_client *ic, char *fmt, ...); #endif bip-0.9.3/src/md5.c0000664000175000017500000002256314212375475010662 00000000000000/* * RFC 1321 compliant MD5 implementation * * Copyright (C) 2001-2003 Christophe Devine * Copyright (C) 2022 Loïc Gomez * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "md5.h" #include "util.h" #define GET_UINT32(n, b, i) \ { \ (n) = ((uint32)(b)[(i)]) | ((uint32)(b)[(i) + 1] << 8) \ | ((uint32)(b)[(i) + 2] << 16) \ | ((uint32)(b)[(i) + 3] << 24); \ } #define PUT_UINT32(n, b, i) \ { \ (b)[(i)] = (uint8)((n)); \ (b)[(i) + 1] = (uint8)((n) >> 8); \ (b)[(i) + 2] = (uint8)((n) >> 16); \ (b)[(i) + 3] = (uint8)((n) >> 24); \ } void md5_starts(md5_context *ctx) { ctx->total[0] = 0; ctx->total[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xEFCDAB89; ctx->state[2] = 0x98BADCFE; ctx->state[3] = 0x10325476; } void md5_process(md5_context *ctx, uint8 data[64]) { uint32 X[16], A, B, C, D; GET_UINT32(X[0], data, 0); GET_UINT32(X[1], data, 4); GET_UINT32(X[2], data, 8); GET_UINT32(X[3], data, 12); GET_UINT32(X[4], data, 16); GET_UINT32(X[5], data, 20); GET_UINT32(X[6], data, 24); GET_UINT32(X[7], data, 28); GET_UINT32(X[8], data, 32); GET_UINT32(X[9], data, 36); GET_UINT32(X[10], data, 40); GET_UINT32(X[11], data, 44); GET_UINT32(X[12], data, 48); GET_UINT32(X[13], data, 52); GET_UINT32(X[14], data, 56); GET_UINT32(X[15], data, 60); #define S(x, n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) #define P(a, b, c, d, k, s, t) \ { \ a += F(b, c, d) + X[k] + t; \ a = S(a, s) + b; \ } A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; #define F(x, y, z) (z ^ (x & (y ^ z))) P(A, B, C, D, 0, 7, 0xD76AA478); P(D, A, B, C, 1, 12, 0xE8C7B756); P(C, D, A, B, 2, 17, 0x242070DB); P(B, C, D, A, 3, 22, 0xC1BDCEEE); P(A, B, C, D, 4, 7, 0xF57C0FAF); P(D, A, B, C, 5, 12, 0x4787C62A); P(C, D, A, B, 6, 17, 0xA8304613); P(B, C, D, A, 7, 22, 0xFD469501); P(A, B, C, D, 8, 7, 0x698098D8); P(D, A, B, C, 9, 12, 0x8B44F7AF); P(C, D, A, B, 10, 17, 0xFFFF5BB1); P(B, C, D, A, 11, 22, 0x895CD7BE); P(A, B, C, D, 12, 7, 0x6B901122); P(D, A, B, C, 13, 12, 0xFD987193); P(C, D, A, B, 14, 17, 0xA679438E); P(B, C, D, A, 15, 22, 0x49B40821); #undef F #define F(x, y, z) (y ^ (z & (x ^ y))) P(A, B, C, D, 1, 5, 0xF61E2562); P(D, A, B, C, 6, 9, 0xC040B340); P(C, D, A, B, 11, 14, 0x265E5A51); P(B, C, D, A, 0, 20, 0xE9B6C7AA); P(A, B, C, D, 5, 5, 0xD62F105D); P(D, A, B, C, 10, 9, 0x02441453); P(C, D, A, B, 15, 14, 0xD8A1E681); P(B, C, D, A, 4, 20, 0xE7D3FBC8); P(A, B, C, D, 9, 5, 0x21E1CDE6); P(D, A, B, C, 14, 9, 0xC33707D6); P(C, D, A, B, 3, 14, 0xF4D50D87); P(B, C, D, A, 8, 20, 0x455A14ED); P(A, B, C, D, 13, 5, 0xA9E3E905); P(D, A, B, C, 2, 9, 0xFCEFA3F8); P(C, D, A, B, 7, 14, 0x676F02D9); P(B, C, D, A, 12, 20, 0x8D2A4C8A); #undef F #define F(x, y, z) (x ^ y ^ z) P(A, B, C, D, 5, 4, 0xFFFA3942); P(D, A, B, C, 8, 11, 0x8771F681); P(C, D, A, B, 11, 16, 0x6D9D6122); P(B, C, D, A, 14, 23, 0xFDE5380C); P(A, B, C, D, 1, 4, 0xA4BEEA44); P(D, A, B, C, 4, 11, 0x4BDECFA9); P(C, D, A, B, 7, 16, 0xF6BB4B60); P(B, C, D, A, 10, 23, 0xBEBFBC70); P(A, B, C, D, 13, 4, 0x289B7EC6); P(D, A, B, C, 0, 11, 0xEAA127FA); P(C, D, A, B, 3, 16, 0xD4EF3085); P(B, C, D, A, 6, 23, 0x04881D05); P(A, B, C, D, 9, 4, 0xD9D4D039); P(D, A, B, C, 12, 11, 0xE6DB99E5); P(C, D, A, B, 15, 16, 0x1FA27CF8); P(B, C, D, A, 2, 23, 0xC4AC5665); #undef F #define F(x, y, z) (y ^ (x | ~z)) P(A, B, C, D, 0, 6, 0xF4292244); P(D, A, B, C, 7, 10, 0x432AFF97); P(C, D, A, B, 14, 15, 0xAB9423A7); P(B, C, D, A, 5, 21, 0xFC93A039); P(A, B, C, D, 12, 6, 0x655B59C3); P(D, A, B, C, 3, 10, 0x8F0CCC92); P(C, D, A, B, 10, 15, 0xFFEFF47D); P(B, C, D, A, 1, 21, 0x85845DD1); P(A, B, C, D, 8, 6, 0x6FA87E4F); P(D, A, B, C, 15, 10, 0xFE2CE6E0); P(C, D, A, B, 6, 15, 0xA3014314); P(B, C, D, A, 13, 21, 0x4E0811A1); P(A, B, C, D, 4, 6, 0xF7537E82); P(D, A, B, C, 11, 10, 0xBD3AF235); P(C, D, A, B, 2, 15, 0x2AD7D2BB); P(B, C, D, A, 9, 21, 0xEB86D391); #undef F ctx->state[0] += A; ctx->state[1] += B; ctx->state[2] += C; ctx->state[3] += D; } void md5_update(md5_context *ctx, uint8 *input, uint32 length) { uint32 left, fill; if (!length) return; left = ctx->total[0] & 0x3F; fill = 64 - left; ctx->total[0] += length; ctx->total[0] &= 0xFFFFFFFF; if (ctx->total[0] < length) ctx->total[1]++; if (left && length >= fill) { memcpy((void *)(ctx->buffer + left), (void *)input, fill); md5_process(ctx, ctx->buffer); length -= fill; input += fill; left = 0; } while (length >= 64) { md5_process(ctx, input); length -= 64; input += 64; } if (length) { memcpy((void *)(ctx->buffer + left), (void *)input, length); } } static uint8 md5_padding[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void md5_finish(md5_context *ctx, uint8 digest[16]) { uint32 last, padn; uint32 high, low; uint8 msglen[8]; high = (ctx->total[0] >> 29) | (ctx->total[1] << 3); low = (ctx->total[0] << 3); PUT_UINT32(low, msglen, 0); PUT_UINT32(high, msglen, 4); last = ctx->total[0] & 0x3F; padn = (last < 56) ? (56 - last) : (120 - last); md5_update(ctx, md5_padding, padn); md5_update(ctx, msglen, (unsigned long)8); PUT_UINT32(ctx->state[0], digest, 0); PUT_UINT32(ctx->state[1], digest, 4); PUT_UINT32(ctx->state[2], digest, 8); PUT_UINT32(ctx->state[3], digest, 12); } #ifdef TEST #include #include /* * those are the standard RFC 1321 test vectors */ static char *msg[] = { "", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "12345678901234567890123456789012345678901234567890123456789012" "345678901234567890"}; static char *val[] = { "d41d8cd98f00b204e9800998ecf8427e", "0cc175b9c0f1b6a831c399e269772661", "900150983cd24fb0d6963f7d28e17f72", "f96b697d7cb7938d525a2f31aaf161d0", "c3fcd3d76192e4007dfb496cca67e13b", "d174ab98d277d9f5a5611c2c9f419d9f", "57edf4a22be3c955ac49da2e2107b67a"}; int main(int argc, char *argv[]) { FILE *f; int i, j; char output[33]; md5_context ctx; unsigned char buf[1000]; unsigned char md5sum[16]; if (argc < 2) { printf("\n MD5 Validation Tests:\n\n"); for (i = 0; i < 7; i++) { printf(" Test %d ", i + 1); md5_starts(&ctx); md5_update(&ctx, (uint8 *)msg[i], strlen(msg[i])); md5_finish(&ctx, md5sum); for (j = 0; j < 16; j++) { sprintf(output + j * 2, "%02x", md5sum[j]); } if (memcmp(output, val[i], 32)) { printf("failed!\n"); return (1); } printf("passed.\n"); } printf("\n"); } else { if (!(f = fopen(argv[1], "rb"))) { perror("fopen"); return (1); } md5_starts(&ctx); while ((i = fread(buf, 1, sizeof(buf), f)) > 0) { md5_update(&ctx, buf, i); } md5_finish(&ctx, md5sum); for (j = 0; j < 16; j++) { printf("%02x", md5sum[j]); } printf(" %s\n", argv[1]); } return (0); } #endif /* this was added for bip */ #include unsigned char *chash_double(char *str, unsigned int seed) { size_t length; md5_context ctx; unsigned char *ptr; unsigned char *md5; length = strlen(str); length += 4; ptr = bip_malloc(length); // conversion from ‘unsigned int’ to ‘unsigned char’ may change value // [-Werror=conversion] #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" ptr[0] = seed >> 24 & 0xff; #pragma GCC diagnostic pop ptr[1] = seed >> 16 & 0xff; ptr[2] = seed >> 8 & 0xff; ptr[3] = seed & 0xff; memcpy(ptr + 4, str, length - 4); md5 = bip_malloc((size_t)16 + 4); memcpy(md5, ptr, (size_t)4); md5_starts(&ctx); md5_update(&ctx, ptr, length); md5_finish(&ctx, md5 + 4); md5_starts(&ctx); md5_update(&ctx, md5, (unsigned long)20); md5_finish(&ctx, md5 + 4); free(ptr); return md5; } int chash_cmp(char *try, unsigned char *pass, unsigned int seed) { int i; unsigned char *try_hash; try_hash = chash_double(try, seed); for (i = 0; i < 20; i++) { if (try_hash[i] != pass[i]) { free(try_hash); return 1; /* like strcmp 0 means == */ } } free(try_hash); return 0; } bip-0.9.3/src/log.c0000664000175000017500000010447214212375475010756 00000000000000/* * $Id: log.c,v 1.56 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2004,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include "log.h" #include "irc.h" #include "util.h" #include #include #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" extern int errno; #pragma GCC diagnostic pop extern int log_level; extern char *conf_log_root; extern char *conf_log_format; extern int conf_log; extern FILE *conf_global_log_file; static size_t _log_write(log_t *logdata, logstore_t *lf, const char *d, const char *str); static char *_log_wrap(const char *dest, const char *line); void logfile_free(logfile_t *lf); void log_drop(log_t *log, const char *storename); static void log_reset(logstore_t *store); #define BOLD_CHAR 0x02 #define LAMESTRING "!bip@" P_SERV " PRIVMSG " #define PMSG_ARROW "\002->\002" int check_dir(char *filename, int is_fatal) { int err; struct stat statbuf; err = stat(filename, &statbuf); if (err && errno == ENOENT) { err = mkdir(filename, 0750); if (err) { if (is_fatal) fatal("mkdir(%s) %s", filename, strerror(errno)); mylog(LOG_ERROR, "mkdir(%s) %s", filename, strerror(errno)); return 1; } } else if (err) { if (is_fatal) fatal("stat(%s) %s", filename, strerror(errno)); mylog(LOG_ERROR, "stat(%s) %s", filename, strerror(errno)); return 1; } else if (!(statbuf.st_mode & S_IFDIR)) { if (is_fatal) fatal("%s is not a directory", filename); mylog(LOG_ERROR, "%s is not a directory", filename); return 1; } return 0; } int check_dir_r(char *dirname) { size_t count = 0; char *dir, *tmp; size_t len = strlen(dirname); size_t pos; mylog(LOG_DEBUGVERB, "Recursive check of %s engaged", dirname); tmp = dirname; dir = (char *)bip_malloc(len + 1); while (*tmp) { int slash_ok = 1; while (*tmp == '/') { if (slash_ok) { strncpy(dir + count, "/", (size_t)2); count++; slash_ok = 0; } tmp++; } pos = strcspn(tmp, "/"); strncpy(dir + count, tmp, pos); tmp += pos; count += pos; *(dir + count) = '\0'; mylog(LOG_DEBUGVERB, "check_dir_r: %s", dir); if (check_dir(dir, 0)) { free(dir); return 1; } } free(dir); return 0; } void strtolower(char *str) { char *c; for (c = str; *c != '\0'; c++) *c = (char)tolower( *c); // tolower()->int but should be safe to cast } /* * Replace all occurences of var in str by value. * This function modifies its first argument! * Truncate the string after max characters. */ void replace_var(char *str, char *var, char *value, unsigned int max) { char *pos; size_t lenvar = strlen(var); size_t lenval = strlen(value); while ((pos = strstr(str, var))) { /* Make room */ if (strlen(str) + lenval - lenvar >= max) return; memmove(pos + lenval, pos + lenvar, strlen(pos + lenvar) + 1); memcpy(pos, value, lenval); } } char *log_build_filename(log_t *logdata, const char *destination) { char *logfile, year[5], day[3], month[3], hour[3], *tmp, *logdir; struct tm *now; time_t s; char *dest = bip_strdup(destination); strtolower(dest); logfile = (char *)bip_malloc((size_t)MAX_PATH_LEN + 1); time(&s); now = localtime(&s); strftime(year, (size_t)5, "%Y", now); strftime(day, (size_t)3, "%d", now); strftime(month, (size_t)3, "%m", now); strftime(hour, (size_t)3, "%H", now); snprintf(logfile, (size_t)MAX_PATH_LEN, "%s/%s", conf_log_root, conf_log_format); replace_var(logfile, "%u", logdata->user->name, MAX_PATH_LEN); replace_var(logfile, "%n", logdata->network, MAX_PATH_LEN); replace_var(logfile, "%c", dest, MAX_PATH_LEN); replace_var(logfile, "%Y", year, MAX_PATH_LEN); replace_var(logfile, "%d", day, MAX_PATH_LEN); replace_var(logfile, "%m", month, MAX_PATH_LEN); replace_var(logfile, "%h", hour, MAX_PATH_LEN); logdir = bip_strdup(logfile); /* strrchr works on bytes, not on char (if sizeof(char) != 1) */ tmp = strrchr(logdir, '/'); if (tmp) *tmp = '\0'; free(dest); if (check_dir_r(logdir)) { free(logfile); free(logdir); return NULL; } free(logdir); return logfile; } void log_updatelast(logfile_t *lf) { time_t t; time(&t); localtime_r(&t, &lf->last_log); } static void log_reset(logstore_t *store) { logfile_t *olf; long ftell_r; store->skip_advance = 0; if (store->memlog) { while (!list_is_empty(store->memlog)) free(list_remove_first(store->memlog)); return; } while ((olf = list_get_first(&store->file_group)) && olf != list_get_last(&store->file_group)) { logfile_free(olf); list_remove_first(&store->file_group); } if (!olf || !olf->file) return; list_it_init_last(&store->file_group, &store->file_it); fseek(olf->file, (long)0, SEEK_END); ftell_r = ftell(olf->file); if (ftell_r < 0) { mylog(LOG_ERROR, "log_reset: ftell error %s", strerror(errno)); return; } store->file_offset = ftell_r; olf->len = (size_t)ftell_r; } void log_reinit(logstore_t *store) { mylog(LOG_ERROR, "%s is inconsistent, droping backlog info", store->name); log_reset(store); } static char *filename_uniq(const char *filename) { struct stat filestat; int i; if (stat(filename, &filestat) != -1) { char *buf = bip_malloc(strlen(filename) + 4 + 1); for (i = 0; i < 256; i++) { sprintf(buf, "%s.%d", filename, i); if (stat(buf, &filestat) == -1) return buf; } free(buf); } return bip_strdup(filename); } static int log_has_file(log_t *logdata, const char *fname) { hash_iterator_t hi; list_iterator_t li; logstore_t *store; for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) { store = hash_it_item(&hi); for (list_it_init(&store->file_group, &li); list_it_item(&li); list_it_next(&li)) { logfile_t *lf = list_it_item(&li); if (strcmp(fname, lf->filename) == 0) return 1; } } return 0; } static int log_add_file(log_t *logdata, const char *destination, const char *filename) { FILE *f; logstore_t *store; char *uniq_fname; char *canonical_fname = NULL; logfile_t *lf = NULL; long ftell_r; if (logdata->log_to_file) { if (log_has_file(logdata, filename)) { canonical_fname = bip_strdup(filename); uniq_fname = filename_uniq(filename); } else { canonical_fname = bip_strdup(filename); uniq_fname = bip_strdup(filename); } f = fopen(uniq_fname, "a+"); if (!f) { mylog(LOG_ERROR, "fopen(%s) %s", uniq_fname, strerror(errno)); free(uniq_fname); free(canonical_fname); return 0; } if (fseek(f, (long)0, SEEK_END) == -1) { mylog(LOG_ERROR, "fseek(%s) %s", uniq_fname, strerror(errno)); free(uniq_fname); free(canonical_fname); fclose(f); return 0; } lf = bip_malloc(sizeof(logfile_t)); lf->file = f; ftell_r = ftell(f); lf->len = (size_t)ftell_r; if (ftell_r < 0) { mylog(LOG_ERROR, "log_add_file: ftell error %s", strerror(errno)); free(uniq_fname); free(canonical_fname); fclose(f); return 0; } lf->filename = uniq_fname; lf->canonical_filename = canonical_fname; log_updatelast(lf); } store = hash_get(&logdata->logfgs, destination); if (!store) { store = bip_calloc(sizeof(logstore_t), (size_t)1); list_init(&store->file_group, NULL); store->name = bip_strdup(destination); store->skip_advance = 0; // should be safe to cast as lf->len comes from ftell() if (lf) store->file_offset = (long)lf->len; hash_insert(&logdata->logfgs, destination, store); } if (!logdata->log_to_file && logdata->user->backlog) { if (!store->memlog) store->memlog = list_new(NULL); } if (lf) { list_add_last(&store->file_group, lf); if (list_it_item(&store->file_it) == NULL) list_it_init_last(&store->file_group, &store->file_it); } return 1; } /* * XXX: must not free file_group */ void logfile_free(logfile_t *lf) { if (!lf) return; if (lf->file) fclose(lf->file); if (lf->filename) free(lf->filename); if (lf->canonical_filename) free(lf->canonical_filename); free(lf); } logstore_t *log_find_file(log_t *logdata, const char *destination) { logfile_t *lf; logstore_t *store; char *filename = NULL; struct link *l; store = hash_get(&logdata->logfgs, destination); if (store && !logdata->log_to_file) return store; if (!store) { if (logdata->log_to_file) { filename = log_build_filename(logdata, destination); if (!filename) return NULL; mylog(LOG_DEBUG, "Creating new logfile for %s: %s", destination, filename); } if (!log_add_file(logdata, destination, filename)) { if (filename) free(filename); return NULL; } store = hash_get(&logdata->logfgs, destination); assert(store); /* ok we are allocating a new store now, let's set it up for * backlogging if applicable */ assert(logdata->user); assert(logdata->network); l = hash_get(&logdata->user->connections, logdata->network); assert(l); struct chan_info *ci = hash_get(&l->chan_infos, destination); if (ci && !ci->backlog) store->track_backlog = 0; else store->track_backlog = 1; if (filename) free(filename); return store; } /* This is reached if store already exists */ lf = list_get_last(&store->file_group); time_t t; struct tm *ltime; time(&t); ltime = localtime(&t); if (ltime->tm_year != lf->last_log.tm_year || ltime->tm_yday != lf->last_log.tm_yday) { logfile_t *oldlf; /* day changed, we might want to rotate logfile */ filename = log_build_filename(logdata, destination); if (!filename) return NULL; if (strcmp(lf->canonical_filename, filename) == 0) { /* finally we don't */ free(filename); return store; } /* we do want to rotate logfiles */ mylog(LOG_DEBUG, "Rotating logfile for %s %s %s", destination, lf->filename, filename); oldlf = list_get_last(&store->file_group); if (!log_add_file(logdata, destination, filename)) { free(filename); return NULL; } free(filename); if (!logdata->user->backlog) { /* remove oldlf from file_group */ assert(list_remove_first(&store->file_group) == oldlf); logfile_free(oldlf); assert(list_get_first(&store->file_group) == list_get_last(&store->file_group)); } else { fclose(oldlf->file); oldlf->file = NULL; } } return store; } void log_join(log_t *logdata, const char *ircmask, const char *channel) { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s has joined %s", timestamp(), ircmask, channel); log_write(logdata, channel, logdata->buffer); } void log_part(log_t *logdata, const char *ircmask, const char *channel, const char *message) { if (message) snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s has left %s [%s]", timestamp(), ircmask, channel, message); else snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s has left %s", timestamp(), ircmask, channel); log_write(logdata, channel, logdata->buffer); } void log_kick(log_t *logdata, const char *ircmask, const char *channel, const char *who, const char *message) { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s has been kicked by %s [%s]", timestamp(), who, ircmask, message); log_write(logdata, channel, logdata->buffer); } void log_quit(log_t *logdata, const char *ircmask, const char *channel, const char *message) { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s has quit [%s]", timestamp(), ircmask, message); log_write(logdata, channel, logdata->buffer); } void log_nick(log_t *logdata, const char *ircmask, const char *channel, const char *newnick) { char *oldnick = nick_from_ircmask(ircmask); logstore_t *oldstore; logstore_t *newstore; if ((oldstore = hash_get(&logdata->logfgs, oldnick))) { if ((newstore = hash_get(&logdata->logfgs, newnick)) && oldstore != newstore) { log_drop(logdata, newnick); } hash_rename_key(&logdata->logfgs, oldnick, newnick); } free(oldnick); snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s is now known as %s", timestamp(), ircmask, newnick); log_write(logdata, channel, logdata->buffer); } static void do_log_privmsg(log_t *logdata, const char *storage, int src, const char *from, const char *message) { char dir = '<'; if (!from) from = "Server message"; if (src) dir = '>'; if (strlen(message) > 8 && ((*message == '\001' || ((*message == '+' || *message == '-') && (*(message + 1) == '\001'))) && (*(message + strlen(message) - 1) == '\001'))) { char *msg; /* hack for freenode and the like */ const char *real_message = message; if (*message == '+' || *message == '-') real_message++; if (strncmp(real_message, "\001ACTION ", (size_t)8) != 0) return; msg = bip_strdup(real_message); *(msg + strlen(msg) - 1) = '\0'; snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s %c * %s %s", timestamp(), dir, from, msg + 8); free(msg); } else { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s %c %s: %s", timestamp(), dir, from, message); } log_write(logdata, storage, logdata->buffer); } void log_privmsg(log_t *logdata, const char *ircmask, const char *destination, const char *message) { // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (!ischannel(*destination)) { char *nick = nick_from_ircmask(ircmask); do_log_privmsg(logdata, nick, 0, ircmask, message); free(nick); } else { do_log_privmsg(logdata, destination, 0, ircmask, message); } #pragma GCC diagnostic pop } void log_cli_privmsg(log_t *logdata, const char *ircmask, const char *destination, const char *message) { do_log_privmsg(logdata, destination, 1, ircmask, message); } void log_notice(log_t *logdata, const char *ircmask, const char *destination, const char *message) { if (!ircmask) ircmask = P_IRCMASK; // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (!ischannel(*destination)) { char *nick = nick_from_ircmask(ircmask); do_log_privmsg(logdata, nick, 0, ircmask, message); free(nick); } else { do_log_privmsg(logdata, destination, 0, ircmask, message); } #pragma GCC diagnostic pop } void log_cli_notice(log_t *logdata, const char *ircmask, const char *destination, const char *message) { do_log_privmsg(logdata, destination, 1, ircmask, message); } void log_topic(log_t *logdata, const char *ircmask, const char *channel, const char *message) { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- %s changed topic of %s to: %s", timestamp(), ircmask, channel, message); log_write(logdata, channel, logdata->buffer); } void log_init_topic(log_t *logdata, const char *channel, const char *message) { snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- Topic for %s: %s", timestamp(), channel, message); log_write(logdata, channel, logdata->buffer); } void log_init_topic_time(log_t *logdata, const char *channel, const char *who, const char *when) { struct tm *time; char *timestr; time_t seconds; seconds = atoi(when); time = localtime(&seconds); timestr = (char *)bip_malloc((size_t)50 + 1); timestr[0] = '\0'; if (time) strftime(timestr, (size_t)50, "%A %d %B %Y, %H:%M:%S", time); timestr[50] = '\0'; snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- Topic set by %s [%s]", timestamp(), who, timestr); free(timestr); log_write(logdata, channel, logdata->buffer); } void log_mode(log_t *logdata, const char *ircmask, const char *channel, const char *modes, array_t *mode_args) { int i; char *tmpbuf = bip_malloc((size_t)LOGLINE_MAXLEN + 1); char *tmpbuf2 = bip_malloc((size_t)LOGLINE_MAXLEN + 1); char *tmp; snprintf(tmpbuf, (size_t)LOGLINE_MAXLEN, "%s -!- mode/%s [%s", timestamp(), channel, modes); if (mode_args) { for (i = 0; i < array_count(mode_args); i++) { snprintf(tmpbuf2, (size_t)LOGLINE_MAXLEN, "%s %s", tmpbuf, (const char *)array_get(mode_args, i)); tmp = tmpbuf; tmpbuf = tmpbuf2; tmpbuf2 = tmp; } } snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s] by %s", tmpbuf, ircmask); log_write(logdata, channel, logdata->buffer); free(tmpbuf); free(tmpbuf2); } void log_disconnected(log_t *logdata) { hash_iterator_t hi; snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- Disconnected" " from server...", timestamp()); for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) log_write(logdata, hash_it_key(&hi), logdata->buffer); } void log_ping_timeout(log_t *logdata) { list_t *l = log_backlogs(logdata); char *s; snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- Ping timeout with server...", timestamp()); while ((s = list_remove_first(l))) { log_write(logdata, s, logdata->buffer); free(s); } list_free(l); log_disconnected(logdata); } void log_connected(log_t *logdata) { hash_iterator_t hi; snprintf(logdata->buffer, (size_t)LOGLINE_MAXLEN, "%s -!- Connected to" " server...", timestamp()); for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) { log_write(logdata, hash_it_key(&hi), logdata->buffer); } } void log_client_disconnected(log_t *logdata) { (void)logdata; mylog(LOG_DEBUG, "A client disconnected"); } void log_store_free(logstore_t *store) { logfile_t *lf; log_reset(store); while ((lf = list_remove_first(&store->file_group))) logfile_free(lf); free(store->name); if (store->memlog) list_free(store->memlog); free(store); } void log_drop(log_t *log, const char *storename) { logstore_t *store; store = hash_remove(&log->logfgs, storename); log_store_free(store); } void log_reset_all(log_t *logdata) { logstore_t *store; hash_iterator_t hi; list_t drop; list_init(&drop, NULL); for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) { store = hash_it_item(&hi); // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (ischannel(*hash_it_key(&hi))) log_reset(store); else list_add_last(&drop, bip_strdup(hash_it_key(&hi))); #pragma GCC diagnostic pop } char *name; while ((name = list_remove_first(&drop))) { log_drop(logdata, name); free(name); } } void log_reset_store(log_t *log, const char *storename) { logstore_t *store; store = hash_get(&log->logfgs, storename); if (store) { log_reset(store); // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (!ischannel(*storename)) log_drop(log, storename); #pragma GCC diagnostic pop } } void log_client_none_connected(log_t *logdata) { logdata->connected = 0; if (logdata->user->always_backlog) return; log_reset_all(logdata); } void log_client_connected(log_t *logdata) { mylog(LOG_DEBUG, "A client connected"); logdata->connected = 1; } void log_advance_backlogs(log_t *ld, logstore_t *store) { int c; // mylog(LOG_ERROR, "LOG: log_advance_backlogs %s", store->name); if (!store->track_backlog) return; if (!ld->user->backlog || ld->user->backlog_lines == 0) return; if (store->skip_advance < ld->user->backlog_lines) { store->skip_advance++; return; } logfile_t *lf; while ((lf = list_it_item(&store->file_it))) { // mylog(LOG_ERROR, "LOG: %s %d", lf->filename, // store->file_offset); if (!lf->file) { lf->file = fopen(lf->filename, "r"); if (!lf->file) { mylog(LOG_ERROR, "Can't open %s for reading", lf->filename); log_reinit(store); return; } } if (fseek(lf->file, store->file_offset, SEEK_SET)) { // mylog(LOG_ERROR, "LOG: fseek FAIL %s %d", // lf->filename, store->file_offset); log_reinit(store); return; } while ((c = fgetc(lf->file)) != EOF) { store->file_offset++; if (c == '\n') { // mylog(LOG_ERROR, "LOG: %s advanced at %d", // lf->filename, store->file_offset); return; } } // mylog(LOG_ERROR, "LOG: %s advanced at %d", lf->filename, // store->file_offset); if (lf == list_get_last(&store->file_group)) { // mylog(LOG_ERROR, "LOG: %s is last of file_group", // lf->filename, store->file_offset); return; } // mylog(LOG_ERROR, "LOG: next file %s %d", lf->filename, // store->file_offset); fclose(lf->file); lf->file = NULL; list_it_next(&store->file_it); store->file_offset = 0; } } int log_has_backlog(log_t *logdata, const char *destination) { logstore_t *store = hash_get(&logdata->logfgs, destination); if (!store) return 0; if (store->memlog) return !list_is_empty(store->memlog); if (!store->track_backlog) return 0; logfile_t *lf; lf = list_it_item(&store->file_it); if (lf != list_get_last(&store->file_group)) return 1; // should be safe to cast to unsigned as we check ftell // when setting file_offset and only ++ since then return (size_t)store->file_offset != lf->len; } /* query: 09-01-2009 14:16:10 < nohar!~nohar@haruka.t1r.net: repl querytest 09-01-2009 14:16:37 > bip4ever: je dis yo la quand meem chan: 09-01-2009 14:15:57 > bip4ever: chantest 09-01-2009 14:16:21 < nohar!~nohar@haruka.t1r.net: chantestrepl */ char *log_beautify(log_t *logdata, const char *buf, const char *storename, const char *dest) { int action = 0; char *p; /* * so = startov, lo = lengthov * ts = timestamp, n = sender nick, m = message or action */ const char *sots, *son, *som; size_t lots, lon, lom; char *ret; int out; assert(buf); p = strchr(buf, ' '); // buf...p if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); p++; // buf...p sots = logdata->user->backlog_timestamp == BLTSDateTime ? buf : p; // buf...sots=p OR sots=buf...p p = strchr(p, ' '); // buf...sots...p OR sots=buf...p if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); lots = (size_t)(p - sots); p++; if (strncmp(p, "-!-", (size_t)3) == 0) { if (logdata->user->bl_msg_only) return NULL; else return _log_wrap(dest, buf); } if (*p == '>') out = 1; else if (*p == '<') out = 0; else return _log_wrap(dest, buf); p++; if (*p != ' ') return _log_wrap(dest, buf); p++; if (*p == '*') { action = 1; if (!p[1] || !p[2]) return _log_wrap(dest, buf); p += 2; } son = p; while (*p && *p != '!' && *p != ' ' && *p != ':') p++; if (!p[0]) return _log_wrap(dest, buf); lon = (size_t)(p - son); p = strchr(p, ' '); if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); p++; // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (out && !ischannel(*dest)) { son = storename; lon = strlen(storename); } #pragma GCC diagnostic pop som = p; lom = strlen(p); if (lom == 0) return _log_wrap(dest, buf); // action and out are 0 or 1, safe to cast p = ret = (char *)bip_malloc(1 + lon + strlen(LAMESTRING) + strlen(dest) + 2 + lots + 2 + lom + 3 + (size_t)action * (2 + strlen("ACTION ")) + (size_t)out * strlen(PMSG_ARROW)); *p++ = ':'; memcpy(p, son, lon); p += lon; strcpy(p, LAMESTRING); p += strlen(LAMESTRING); memcpy(p, dest, strlen(dest)); p += strlen(dest); // memcpy(p, sod, lod); // p += lod; *p++ = ' '; *p++ = ':'; if (action) { *p++ = 1; strcpy(p, "ACTION "); p += strlen("ACTION "); } // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (out && !ischannel(*dest)) { strcpy(p, PMSG_ARROW); p += strlen(PMSG_ARROW); } #pragma GCC diagnostic pop if (logdata->user->backlog_timestamp != BLTSNone) { memcpy(p, sots, lots); p += lots; *p++ = '>'; *p++ = ' '; } memcpy(p, som, lom); p += lom; if (action) *p++ = 1; *p++ = '\r'; *p++ = '\n'; *p = 0; return ret; } static time_t compute_time(const char *buf) { struct tm tm; time_t tv; /* this is to fill tm_isdst to current tm, expect brokennes when dst * changes */ time(&tv); tm = *localtime(&tv); if (strptime(buf, "%d-%m-%Y %H:%M:%S", &tm) == NULL) return (time_t)-1; return mktime(&tm); } static int log_backread_file(log_t *log, logstore_t *store, logfile_t *lf, list_t *res, const char *dest, time_t start) { char *buf, *logbr; int close = 0; // mylog(LOG_ERROR, "log_backread_file store:", store->name); if (!lf->file) { lf->file = fopen(lf->filename, "r"); if (!lf->file) { mylog(LOG_ERROR, "Can't open %s for reading", lf->filename); list_add_last(res, _log_wrap("Error opening logfile", store->name)); return 0; } close = 1; } if (!start && list_it_item(&store->file_it) == lf) { /* mylog(LOG_ERROR, "bread Seeking %s to %d", lf->filename, store->file_offset); */ if (fseek(lf->file, store->file_offset, SEEK_SET)) { mylog(LOG_ERROR, "Can't seek in %s", lf->filename); list_add_last(res, _log_wrap(store->name, "Error seeking in logfile")); return 0; } } else { // mylog(LOG_ERROR, "bread Seeking %s to %d", lf->filename, 0); if (fseek(lf->file, (long)0, SEEK_SET)) { mylog(LOG_ERROR, "Can't seek in %s", lf->filename); list_add_last(res, _log_wrap(store->name, "Error seeking in logfile")); return 0; } } buf = bip_malloc((size_t)LOGLINE_MAXLEN + 1); for (;;) { if (!fgets(buf, LOGLINE_MAXLEN, lf->file)) { if (ferror(lf->file)) { list_add_last(res, _log_wrap("Error reading " "logfile", store->name)); } /* error or oef */ break; } size_t slen = strlen(buf); if (slen == 0) break; // should not happen, per previous fgets block if (buf[slen - 1] == '\n') buf[slen - 1] = 0; if (slen >= 2 && buf[slen] == '\r') buf[slen - 2] = 0; if (buf[0] == 0 || buf[0] == '\n') continue; if (start != 0) { time_t linetime = compute_time(buf); /* parse error, don't backlog */ if (linetime == (time_t)-1) { list_add_last(res, _log_wrap("Error in " "timestamp in %s", store->name)); continue; } /* too old line, don't backlog */ if (linetime < start) continue; } logbr = log_beautify(log, buf, store->name, dest); if (logbr) list_add_last(res, logbr); } if (close) { fclose(lf->file); lf->file = NULL; } free(buf); // mylog(LOG_ERROR, "end of log_backread_file store: %s", store->name); return 1; } static list_t *log_backread(log_t *log, const char *storename, const char *dest) { list_t *ret; if (!log->user->always_backlog && log->connected) return NULL; logstore_t *store = hash_get(&log->logfgs, storename); if (!store) return NULL; if (!store->track_backlog) return NULL; if (store->memlog) { list_iterator_t li; ret = list_new(NULL); for (list_it_init(store->memlog, &li); list_it_item(&li); list_it_next(&li)) list_add_last(ret, bip_strdup(list_it_item(&li))); return ret; } if (!log->log_to_file) { mylog(LOG_DEBUG, "No conf_log, not backlogging"); return NULL; } list_iterator_t file_it = store->file_it; logfile_t *logf; ret = list_new(NULL); for (file_it = store->file_it; (logf = list_it_item(&file_it)); list_it_next(&file_it)) { if (!log_backread_file(log, store, logf, ret, dest, (time_t)0)) { log_reinit(store); return ret; } } return ret; } static char *_log_wrap(const char *dest, const char *line) { char *buf; int count; buf = bip_malloc((size_t)LOGLINE_MAXLEN + 1); count = snprintf(buf, (size_t)LOGLINE_MAXLEN + 1, ":" P_IRCMASK " PRIVMSG %s :%s\r\n", dest, line); if (count < 0) { mylog(LOG_ERROR, "_log_wrap: error on snprintf: %s", strerror(errno)); buf[LOGLINE_MAXLEN - 2] = '\r'; buf[LOGLINE_MAXLEN - 1] = '\n'; buf[LOGLINE_MAXLEN] = 0; return buf; } if (count >= LOGLINE_MAXLEN + 1) { mylog(LOG_WARN, "_log_wrap: line too long"); buf[LOGLINE_MAXLEN - 2] = '\r'; buf[LOGLINE_MAXLEN - 1] = '\n'; buf[LOGLINE_MAXLEN] = 0; } return buf; } static size_t _log_write(log_t *logdata, logstore_t *store, const char *destination, const char *str) { size_t nbwrite; size_t len; static char tmpstr[LOGLINE_MAXLEN + 1]; strncpy(tmpstr, str, (size_t)LOGLINE_MAXLEN); tmpstr[LOGLINE_MAXLEN] = 0; if (store->memlog) { char *r = log_beautify(logdata, tmpstr, store->name, destination); if (r != NULL) { list_add_last(store->memlog, r); if (store->memc == logdata->user->backlog_lines) free(list_remove_first(store->memlog)); else store->memc++; } } if (!logdata->log_to_file) return 0; logfile_t *lf = list_get_last(&store->file_group); len = strlen(tmpstr); nbwrite = fwrite(tmpstr, sizeof(char), len, lf->file); nbwrite += fwrite("\n", sizeof(char), (size_t)1, lf->file); log_updatelast(lf); if (nbwrite != len + 1) mylog(LOG_ERROR, "Error writing to %s logfile", lf->filename); lf->len += nbwrite; if (!logdata->connected || logdata->user->always_backlog) log_advance_backlogs(logdata, store); return nbwrite; } void log_write(log_t *logdata, const char *destination, const char *str) { logstore_t *store = log_find_file(logdata, destination); size_t written; if (!store) { mylog(LOG_ERROR, "Unable to find/create logfile for '%s'", destination); return; } written = _log_write(logdata, store, destination, str); if (written <= 0) mylog(LOG_WARN, "log_write to '%s' failed", destination); } static list_t *log_all_logs = NULL; void log_flush_all(void) { list_iterator_t li; if (!log_all_logs) return; fflush(conf_global_log_file); for (list_it_init(log_all_logs, &li); list_it_item(&li); list_it_next(&li)) { log_t *log = list_it_item(&li); hash_iterator_t hi; for (hash_it_init(&log->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) { logstore_t *store = hash_it_item(&hi); list_iterator_t lj; for (list_it_init(&store->file_group, &lj); list_it_item(&lj); list_it_next(&lj)) { logfile_t *lf = list_it_item(&lj); if (lf->file) fflush(lf->file); } } } } log_t *log_new(struct bipuser *user, const char *network) { log_t *logdata; logdata = (log_t *)bip_calloc(sizeof(log_t), (size_t)1); logdata->user = user; logdata->network = bip_strdup(network); hash_init(&logdata->logfgs, HASH_NOCASE); logdata->buffer = (char *)bip_malloc((size_t)LOGLINE_MAXLEN + 1); logdata->buffer[LOGLINE_MAXLEN - 1] = 0; // debug logdata->buffer[LOGLINE_MAXLEN] = 0; logdata->connected = 0; logdata->log_to_file = conf_log; if (!log_all_logs) log_all_logs = list_new(list_ptr_cmp); list_add_last(log_all_logs, logdata); return logdata; } void log_free(log_t *log) { hash_iterator_t it; logstore_t *store; list_remove(log_all_logs, log); free(log->network); free(log->buffer); for (hash_it_init(&log->logfgs, &it); (store = hash_it_item(&it)); hash_it_next(&it)) { log_reset(store); log_store_free(store); } hash_clean(&log->logfgs); free(log); } list_t *log_backlogs(log_t *log) { return hash_keys(&log->logfgs); } array_t *str_split(const char *str, const char *splt) { const char *p = str; const char *start = str; size_t len; char *extracted; array_t *array = array_new(); ; do { if (!*p || strchr(splt, *p)) { len = (size_t)(p - start); extracted = bip_malloc(len + 1); memcpy(extracted, start, len); extracted[len] = 0; array_push(array, extracted); if (!*p) return array; else start = p + 1; } } while (*p++); fatal("never reached"); return NULL; } /* 26-12-2008 08:54:39 */ int log_parse_date(char *strdate, int *year, int *month, int *mday, int *hour, int *min, int *sec) { array_t *fields; char *sptr; int ret = 0; fields = str_split(strdate, ":- "); if (array_count(fields) == 6) { *year = atoi(array_get(fields, 2)); *month = atoi(array_get(fields, 1)); *mday = atoi(array_get(fields, 0)); *hour = atoi(array_get(fields, 3)); *min = atoi(array_get(fields, 4)); *sec = atoi(array_get(fields, 5)); ret = 1; } int i; array_each(fields, i, sptr) free(sptr); array_free(fields); return ret; } void logstore_get_file_at(logstore_t *store, time_t at, list_iterator_t *li) { for (list_it_init(&store->file_group, li); list_it_item(li); list_it_next(li)) { logfile_t *lf = list_it_item(li); if (mktime(&lf->last_log) > at) return; } } static list_t *log_backread_hours(log_t *log, const char *storename, const char *dest, int hours) { time_t blstarttime; struct timeval tv; logstore_t *store; logfile_t *logf; list_t *ret; list_iterator_t file_it; gettimeofday(&tv, NULL); if (tv.tv_sec <= 3600 * hours) return NULL; blstarttime = tv.tv_sec - 3600 * hours; store = hash_get(&log->logfgs, storename); if (!store) return NULL; ret = list_new(NULL); for (logstore_get_file_at(store, blstarttime, &file_it); (logf = list_it_item(&file_it)); list_it_next(&file_it)) { if (!log_backread_file(log, store, logf, ret, dest, blstarttime)) { log_reinit(store); return ret; } } return ret; } list_t *backlog_lines(log_t *log, const char *bl, const char *cli_nick, int hours) { list_t *ret; struct line l; const char *dest; ret = NULL; // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (ischannel(*bl)) dest = bl; else dest = cli_nick; #pragma GCC diagnostic pop if (log_has_backlog(log, bl) || hours) { if (hours == 0) ret = log_backread(log, bl, dest); else ret = log_backread_hours(log, bl, dest, hours); if (ret && !list_is_empty(ret)) { /* * This exception is cosmetic, but you want it. * Most of the time, you get backlog from your own nick * for your mode changes only. * Hence opening a query just to say "end of backlog"... */ if (strcmp(bl, cli_nick) != 0) { /* clean this up */ irc_line_init(&l); l.origin = P_IRCMASK; if (dest == cli_nick) l.origin = bip_strdup(bl); _irc_line_append(&l, "PRIVMSG"); _irc_line_append(&l, dest); _irc_line_append(&l, "End of backlog"); list_add_last(ret, irc_line_to_string(&l)); _irc_line_deinit(&l); } } } return ret; } bip-0.9.3/src/line.h0000664000175000017500000001160614212375475011125 00000000000000/* * $Id$ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef IRC_LINE_H #define IRC_LINE_H #include "connection.h" #define WRITE_LINE0(con, org, com) \ do { \ struct line l; \ irc_line_init(&l); \ l.origin = org; \ _irc_line_append(&l, com); \ irc_line_write(&l, con); \ _irc_line_deinit(&l); \ } while (0) #define WRITE_LINE1(con, org, com, a) \ do { \ struct line l; \ irc_line_init(&l); \ l.origin = org; \ _irc_line_append(&l, com); \ _irc_line_append(&l, a); \ irc_line_write(&l, con); \ _irc_line_deinit(&l); \ } while (0) #define WRITE_LINE2(con, org, com, a1, a2) \ do { \ struct line l; \ irc_line_init(&l); \ l.origin = org; \ _irc_line_append(&l, com); \ _irc_line_append(&l, a1); \ _irc_line_append(&l, a2); \ irc_line_write(&l, con); \ _irc_line_deinit(&l); \ } while (0) #define WRITE_LINE3(con, org, com, a1, a2, a3) \ do { \ struct line l; \ irc_line_init(&l); \ l.origin = org; \ _irc_line_append(&l, com); \ _irc_line_append(&l, a1); \ _irc_line_append(&l, a2); \ _irc_line_append(&l, a3); \ irc_line_write(&l, con); \ _irc_line_deinit(&l); \ } while (0) #define WRITE_LINE4(con, org, com, a1, a2, a3, a4) \ do { \ struct line l; \ irc_line_init(&l); \ l.origin = org; \ _irc_line_append(&l, com); \ _irc_line_append(&l, a1); \ _irc_line_append(&l, a2); \ _irc_line_append(&l, a3); \ _irc_line_append(&l, a4); \ irc_line_write(&l, con); \ _irc_line_deinit(&l); \ } while (0) struct line { char *origin; array_t words; int colon; }; void irc_line_init(struct line *l); void _irc_line_deinit(struct line *l); struct line *irc_line_new(void); void irc_line_write(struct line *l, connection_t *c); void irc_line_append(struct line *l, const char *s); struct line *irc_line_new_from_string(char *str); char *irc_line_to_string(struct line *l); char *irc_line_to_string_to(struct line *line, char *nick); void irc_line_free(struct line *l); struct line *irc_line_dup(struct line *line); void _irc_line_append(struct line *l, const char *s); int irc_line_includes(struct line *line, int elem); const char *irc_line_elem(struct line *line, int elem); int irc_line_count(struct line *line); char *irc_line_pop(struct line *l); int irc_line_elem_equals(struct line *line, int elem, const char *cmp); int irc_line_elem_case_equals(struct line *line, int elem, const char *cmp); void irc_line_drop(struct line *line, int elem); #endif bip-0.9.3/src/line.c0000664000175000017500000001074714212375475011125 00000000000000/* * $Id$ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include "line.h" #include "util.h" // TODO resolve assuming signed overflow does not occur when changing X +- C1 // cmp C2 to X cmp C2 -+ C1 #pragma GCC diagnostic ignored "-Wstrict-overflow" void irc_line_init(struct line *l) { memset(l, 0, sizeof(struct line)); array_init(&l->words); } void _irc_line_deinit(struct line *l) { array_deinit(&l->words); } struct line *irc_line_new() { struct line *l; l = bip_malloc(sizeof(struct line)); irc_line_init(l); return l; } void irc_line_write(struct line *l, connection_t *c) { char *bytes = irc_line_to_string(l); write_line(c, bytes); free(bytes); } struct line *irc_line_dup(struct line *line) { int i; struct line *nl = irc_line_new(); char *ptr; nl->origin = line->origin ? bip_strdup(line->origin) : NULL; array_each(&line->words, i, ptr) array_set(&nl->words, i, bip_strdup(ptr)); nl->colon = line->colon; return nl; } char *irc_line_pop(struct line *l) { return (char *)array_pop(&l->words); } void _irc_line_append(struct line *l, const char *s) { array_push(&l->words, bip_strdup(s)); } void irc_line_append(struct line *l, const char *s) { _irc_line_append(l, bip_strdup(s)); } char *irc_line_to_string(struct line *l) { size_t len = 0; int i; char *ret; if (l->origin) len = strlen(l->origin) + 2; for (i = 0; i < array_count(&l->words); i++) len += strlen(array_get(&l->words, i)) + 1; len += 1; /* remove one trailing space and add \r\n */ len++; /* last args ":" */ ret = bip_malloc(len + 1); ret[0] = 0; if (l->origin) { strcat(ret, ":"); strcat(ret, l->origin); strcat(ret, " "); } for (i = 0; i < array_count(&l->words) - 1; i++) { strcat(ret, array_get(&l->words, i)); strcat(ret, " "); } if (strchr(array_get(&l->words, i), ' ') || l->colon) strcat(ret, ":"); strcat(ret, array_get(&l->words, i)); strcat(ret, "\r\n"); return ret; } char *irc_line_to_string_to(struct line *line, char *nick) { char *tmp; char *l; const char *prev; prev = irc_line_elem(line, 1); tmp = bip_strdup(prev); array_set(&line->words, 1, nick); l = irc_line_to_string(line); array_set(&line->words, 1, tmp); bip_cfree(prev); return l; } int irc_line_count(struct line *line) { return array_count(&line->words); } int irc_line_includes(struct line *line, int elem) { return array_includes(&line->words, elem); } const char *irc_line_elem(struct line *line, int elem) { return array_get(&line->words, elem); } void irc_line_drop(struct line *line, int elem) { bip_cfree(array_drop(&line->words, elem)); } int irc_line_elem_equals(struct line *line, int elem, const char *cmp) { return !strcmp(irc_line_elem(line, elem), cmp); } int irc_line_elem_case_equals(struct line *line, int elem, const char *cmp) { return !strcasecmp(irc_line_elem(line, elem), cmp); } /* * takes a null terminated string as input w/o \r\n */ struct line *irc_line_new_from_string(char *str) { struct line *line; char *space; size_t len; line = irc_line_new(); if (str[0] == ':') { space = str + 1; while (*space && *space != ' ') space++; if (!*space) { irc_line_free(line); return NULL; } // space is at least str + 1, len >= 0 len = (size_t)(space - str - 1); /* leading ':' */ line->origin = bip_malloc(len + 1); memcpy(line->origin, str + 1, len); line->origin[len] = 0; str = space; } while (*str == ' ') str++; while (*str) { char *tmp; space = str; if (*space == ':') { line->colon = 1; str++; while (*space) space++; } else { while (*space && *space != ' ') space++; } // str is the start of string // space is the end of string or end of word len = (size_t)(space - str); tmp = bip_malloc(len + 1); memcpy(tmp, str, len); tmp[len] = 0; if (array_count(&line->words) == 0) strucase(tmp); array_push(&line->words, tmp); str = space; while (*str == ' ') str++; } return line; } void irc_line_free(struct line *l) { int i; for (i = 0; i < array_count(&l->words); i++) bip_cfree(array_get(&l->words, i)); array_deinit(&l->words); if (l->origin) free(l->origin); free(l); } bip-0.9.3/src/tuple.h0000664000175000017500000000120712442320231011302 00000000000000/* * $Id: conf.h,v 1.5 2005/04/17 15:20:32 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004 2005 Arnaud Cornet and Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef TUPLE_H #define TUPLE_H #define TUPLE_STR 0 #define TUPLE_INT 1 #define TUPLE_LIST 2 struct tuple { int type; void *pdata; int ndata; int tuple_type; }; #endif bip-0.9.3/src/util.h0000664000175000017500000001652014212375475011153 00000000000000/* * $Id: util.h,v 1.35 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef UTIL_H #define UTIL_H #include #include #include #include #include /* Warning: must be in order, 0 = less output */ #define LOG_FATAL 0 #define LOG_ERROR 1 #define LOG_WARN 2 #define LOG_INFO 3 #define LOG_DEBUG 4 #define LOG_DEBUGVERB 5 #define LOG_DEBUGTOOMUCH 6 #define HASH_NOCASE 1 #define HASH_DEFAULT 0 void mylog(int level, char *fmt, ...); void _mylog(int level, char *fmt, va_list ap); void fatal(char *fmt, ...); char *timestamp(void); struct hash_item; struct list_item { struct list_item *next; struct list_item *prev; void *ptr; }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" typedef struct list { struct list_item *first; struct list_item *last; int (*cmp)(); } list_t; #pragma GCC diagnostic pop typedef struct list_iterator { list_t *list; struct list_item *cur; struct list_item *next; } list_iterator_t; typedef struct hash { list_t lists[256]; } hash_t; typedef struct hash_iterator { int list; list_iterator_t lit; struct hash_item *cur; hash_t *hash; } hash_iterator_t; typedef struct array { int elemc; const void **elemv; } array_t; #define MOVE_STRING(dest, src) \ do { \ if (dest) \ free(dest); \ (dest) = (src); \ (src) = NULL; \ } while (0) #define FREE(a) \ free(a); \ (a) = NULL; #define MAYFREE(a) \ do { \ if (a) { \ free(a); \ (a) = NULL; \ } \ } while (0); #define assert(condition) \ do { \ if (!(condition)) \ fatal("Failed assertion in " __FILE__ \ "(%d): " #condition, \ __LINE__); \ } while (0) #define assert_msg(condition, msg) \ do { \ if (!(condition)) \ fatal("%s in " __FILE__ "(%d): " #condition, (msg), \ __LINE__); \ } while (0) void list_init(list_t *list, int (*cmp)(const void *, const void *)); int list_ptr_cmp(const void *a, const void *b); list_t *list_new(int (*cmp)(const void *, const void *)); void *list_remove(list_t *list, const void *ptr); void *list_remove_if_exists(list_t *list, const void *ptr); void *list_get(list_t *list, const void *ptr); void list_add_first(list_t *list, void *ptr); void list_add_first_uniq(list_t *list, void *ptr); void list_add_last(list_t *list, void *ptr); void *list_get_first(list_t *list); void *list_get_last(list_t *list); void *list_remove_first(list_t *list); void *list_remove_last(list_t *list); void list_it_init(list_t *list, list_iterator_t *ti); void list_it_init_last(list_t *list, list_iterator_t *ti); void *list_it_remove(list_iterator_t *li); void list_free(list_t *t); void list_append(list_t *dest, list_t *src); int list_is_empty(list_t *l); static inline void list_it_next(list_iterator_t *ti) { assert(ti); if (ti->cur) { if (ti->next) fatal("list_it_next: inconsistent iterator state"); ti->cur = ti->cur->next; } else if (ti->next) { ti->cur = ti->next; ti->next = NULL; } } static inline void *list_it_item(list_iterator_t *ti) { assert(ti); if (!ti->cur) return NULL; return ti->cur->ptr; } void hash_init(hash_t *h, int); void hash_free(hash_t *h); void hash_clean(hash_t *h); hash_t *hash_new(int options); void hash_insert(hash_t *hash, const char *key, void *ptr); int hash_includes(hash_t *hash, const char *key); void *hash_get(hash_t *, const char *key); void *hash_remove(hash_t *hash, const char *key); void *hash_remove_if_exists(hash_t *hash, const char *key); int hash_is_empty(hash_t *h); void hash_it_init(hash_t *hash, hash_iterator_t *i); void hash_it_next(hash_iterator_t *hi); void *hash_it_item(hash_iterator_t *h); const char *hash_it_key(hash_iterator_t *h); void *hash_it_remove(hash_iterator_t *li); list_t *hash_keys(hash_t *hash); void hash_rename_key(hash_t *h, const char *oldk, const char *newk); int is_valid_nick(char *str); int is_valid_username(char *str); char *bip_strmaydup(char *s); void strucase(char *s); int ischannel(char p); char *hrtime(time_t t); #ifdef HAVE_LIBSSL char *checkmode2text(int v); #endif #define bool2text(v) ((v) ? "true" : "false") void *bip_malloc(size_t size); void *bip_calloc(size_t nmemb, size_t size); void *bip_realloc(void *ptr, size_t size); void bip_cfree(const void *ptr); char *bip_strdup(const char *str); char *bip_strcat_fit(size_t *remaining, char *str, const char *str2); char *bip_strcatf_fit(size_t *remaining, char *str, const char *str2, ...); void bip_clock_gettime(clockid_t clockid, struct timespec *tp); #define array_each(a, idx, ptr) \ for ((idx) = 0; (idx) < (a)->elemc \ && (((ptr) = bip_strdup(array_get((a), (idx)))) || 1); \ (idx)++) void array_init(array_t *a); array_t *array_new(void); void array_ensure(array_t *a, int index); array_t *array_extract(array_t *a, int index, int upto); void array_deinit(array_t *a); void array_free(array_t *a); const void *array_drop(array_t *a, int index); static inline int array_count(array_t *a) { assert(a); return a->elemc; } static inline int array_includes(array_t *a, int index) { assert(a && index >= 0); return a->elemc > index; } static inline void array_set(array_t *a, int index, void *ptr) { assert(a); array_ensure(a, index); a->elemv[index] = ptr; } static inline const void *array_get(array_t *a, int index) { assert(a && array_includes(a, index)); return a->elemv[index]; } static inline void array_push(array_t *a, void *ptr) { int idx; assert(a); idx = a->elemc; array_ensure(a, idx); a->elemv[idx] = ptr; } static inline void *array_pop(array_t *a) { assert(a); if (a->elemc == 0) return NULL; if (a->elemc == 1) { void *ptr = bip_strdup(a->elemv[0]); free(a->elemv); a->elemv = NULL; a->elemc = 0; return ptr; } return (void *)bip_strdup(a->elemv[--a->elemc]); } #endif bip-0.9.3/src/conf.c0000664000175000017500000024345014212410721011102 00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ #define YYBISON 30802 /* Bison version string. */ #define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 1 "conf.y" /* * $Id: conf.y,v 1.26 2005/04/17 15:20:32 nohar Exp $ * * This file is part of the bip proproject * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include #include "util.h" #include "irc.h" #include "tuple.h" extern int yylex (void); extern char *yytext; extern int linec; #define YYMALLOC bip_malloc extern int yyerror(char *); int yywrap(void) { return 1; } //int yydebug = 1; list_t *root_list; struct tuple *tuple_i_new(int type, int i) { struct tuple *t; t = bip_malloc(sizeof(struct tuple)); t->type = type; t->ndata = i; t->tuple_type = TUPLE_INT; return t; } struct tuple *tuple_p_new(int type, void *p) { struct tuple *t; t = bip_malloc(sizeof(struct tuple)); t->type = type; t->pdata = p; return t; } struct tuple *tuple_s_new(int type, void *p) { struct tuple *t = tuple_p_new(type, p); t->tuple_type = TUPLE_STR; return t; } struct tuple *tuple_l_new(int type, void *p) { struct tuple *t = tuple_p_new(type, p); t->tuple_type = TUPLE_LIST; return t; } #line 142 "conf.c" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Use api.header.include to #include this header instead of duplicating it here. */ #ifndef YY_YY_CONF_H_INCLUDED # define YY_YY_CONF_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ LEX_IP = 258, /* LEX_IP */ LEX_EQ = 259, /* LEX_EQ */ LEX_PORT = 260, /* LEX_PORT */ LEX_CSS = 261, /* LEX_CSS */ LEX_SEMICOLON = 262, /* LEX_SEMICOLON */ LEX_CONNECTION = 263, /* LEX_CONNECTION */ LEX_NETWORK = 264, /* LEX_NETWORK */ LEX_LBRA = 265, /* LEX_LBRA */ LEX_RBRA = 266, /* LEX_RBRA */ LEX_USER = 267, /* LEX_USER */ LEX_NAME = 268, /* LEX_NAME */ LEX_NICK = 269, /* LEX_NICK */ LEX_SERVER = 270, /* LEX_SERVER */ LEX_PASSWORD = 271, /* LEX_PASSWORD */ LEX_SRCIP = 272, /* LEX_SRCIP */ LEX_HOST = 273, /* LEX_HOST */ LEX_VHOST = 274, /* LEX_VHOST */ LEX_SOURCE_PORT = 275, /* LEX_SOURCE_PORT */ LEX_NONE = 276, /* LEX_NONE */ LEX_COMMENT = 277, /* LEX_COMMENT */ LEX_BUNCH = 278, /* LEX_BUNCH */ LEX_REALNAME = 279, /* LEX_REALNAME */ LEX_SSL = 280, /* LEX_SSL */ LEX_SSL_CHECK_MODE = 281, /* LEX_SSL_CHECK_MODE */ LEX_SSL_CHECK_STORE = 282, /* LEX_SSL_CHECK_STORE */ LEX_SSL_CLIENT_CERTFILE = 283, /* LEX_SSL_CLIENT_CERTFILE */ LEX_CIPHERS = 284, /* LEX_CIPHERS */ LEX_CSS_CIPHERS = 285, /* LEX_CSS_CIPHERS */ LEX_DEFAULT_CIPHERS = 286, /* LEX_DEFAULT_CIPHERS */ LEX_DH_PARAM = 287, /* LEX_DH_PARAM */ LEX_CHANNEL = 288, /* LEX_CHANNEL */ LEX_KEY = 289, /* LEX_KEY */ LEX_LOG_ROOT = 290, /* LEX_LOG_ROOT */ LEX_LOG_FORMAT = 291, /* LEX_LOG_FORMAT */ LEX_LOG_LEVEL = 292, /* LEX_LOG_LEVEL */ LEX_BACKLOG_LINES = 293, /* LEX_BACKLOG_LINES */ LEX_BACKLOG_TIMESTAMP = 294, /* LEX_BACKLOG_TIMESTAMP */ LEX_BACKLOG_NO_TIMESTAMP = 295, /* LEX_BACKLOG_NO_TIMESTAMP */ LEX_BACKLOG = 296, /* LEX_BACKLOG */ LEX_LOG = 297, /* LEX_LOG */ LEX_LOG_SYSTEM = 298, /* LEX_LOG_SYSTEM */ LEX_LOG_SYNC_INTERVAL = 299, /* LEX_LOG_SYNC_INTERVAL */ LEX_FOLLOW_NICK = 300, /* LEX_FOLLOW_NICK */ LEX_ON_CONNECT_SEND = 301, /* LEX_ON_CONNECT_SEND */ LEX_AWAY_NICK = 302, /* LEX_AWAY_NICK */ LEX_PID_FILE = 303, /* LEX_PID_FILE */ LEX_WRITE_OIDENTD = 304, /* LEX_WRITE_OIDENTD */ LEX_OIDENTD_FILE = 305, /* LEX_OIDENTD_FILE */ LEX_IGN_FIRST_NICK = 306, /* LEX_IGN_FIRST_NICK */ LEX_ALWAYS_BACKLOG = 307, /* LEX_ALWAYS_BACKLOG */ LEX_BLRESET_ON_TALK = 308, /* LEX_BLRESET_ON_TALK */ LEX_BLRESET_CONNECTION = 309, /* LEX_BLRESET_CONNECTION */ LEX_DEFAULT_USER = 310, /* LEX_DEFAULT_USER */ LEX_DEFAULT_NICK = 311, /* LEX_DEFAULT_NICK */ LEX_DEFAULT_REALNAME = 312, /* LEX_DEFAULT_REALNAME */ LEX_NO_CLIENT_AWAY_MSG = 313, /* LEX_NO_CLIENT_AWAY_MSG */ LEX_BL_MSG_ONLY = 314, /* LEX_BL_MSG_ONLY */ LEX_ADMIN = 315, /* LEX_ADMIN */ LEX_BIP_USE_NOTICE = 316, /* LEX_BIP_USE_NOTICE */ LEX_CSS_PEM = 317, /* LEX_CSS_PEM */ LEX_AUTOJOIN_ON_KICK = 318, /* LEX_AUTOJOIN_ON_KICK */ LEX_IGNORE_CAPAB = 319, /* LEX_IGNORE_CAPAB */ LEX_RECONN_TIMER = 320, /* LEX_RECONN_TIMER */ LEX_SASL_USERNAME = 321, /* LEX_SASL_USERNAME */ LEX_SASL_PASSWORD = 322, /* LEX_SASL_PASSWORD */ LEX_SASL_MECHANISM = 323, /* LEX_SASL_MECHANISM */ LEX_BOOL = 324, /* LEX_BOOL */ LEX_INT = 325, /* LEX_INT */ LEX_STRING = 326 /* LEX_STRING */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define LEX_IP 258 #define LEX_EQ 259 #define LEX_PORT 260 #define LEX_CSS 261 #define LEX_SEMICOLON 262 #define LEX_CONNECTION 263 #define LEX_NETWORK 264 #define LEX_LBRA 265 #define LEX_RBRA 266 #define LEX_USER 267 #define LEX_NAME 268 #define LEX_NICK 269 #define LEX_SERVER 270 #define LEX_PASSWORD 271 #define LEX_SRCIP 272 #define LEX_HOST 273 #define LEX_VHOST 274 #define LEX_SOURCE_PORT 275 #define LEX_NONE 276 #define LEX_COMMENT 277 #define LEX_BUNCH 278 #define LEX_REALNAME 279 #define LEX_SSL 280 #define LEX_SSL_CHECK_MODE 281 #define LEX_SSL_CHECK_STORE 282 #define LEX_SSL_CLIENT_CERTFILE 283 #define LEX_CIPHERS 284 #define LEX_CSS_CIPHERS 285 #define LEX_DEFAULT_CIPHERS 286 #define LEX_DH_PARAM 287 #define LEX_CHANNEL 288 #define LEX_KEY 289 #define LEX_LOG_ROOT 290 #define LEX_LOG_FORMAT 291 #define LEX_LOG_LEVEL 292 #define LEX_BACKLOG_LINES 293 #define LEX_BACKLOG_TIMESTAMP 294 #define LEX_BACKLOG_NO_TIMESTAMP 295 #define LEX_BACKLOG 296 #define LEX_LOG 297 #define LEX_LOG_SYSTEM 298 #define LEX_LOG_SYNC_INTERVAL 299 #define LEX_FOLLOW_NICK 300 #define LEX_ON_CONNECT_SEND 301 #define LEX_AWAY_NICK 302 #define LEX_PID_FILE 303 #define LEX_WRITE_OIDENTD 304 #define LEX_OIDENTD_FILE 305 #define LEX_IGN_FIRST_NICK 306 #define LEX_ALWAYS_BACKLOG 307 #define LEX_BLRESET_ON_TALK 308 #define LEX_BLRESET_CONNECTION 309 #define LEX_DEFAULT_USER 310 #define LEX_DEFAULT_NICK 311 #define LEX_DEFAULT_REALNAME 312 #define LEX_NO_CLIENT_AWAY_MSG 313 #define LEX_BL_MSG_ONLY 314 #define LEX_ADMIN 315 #define LEX_BIP_USE_NOTICE 316 #define LEX_CSS_PEM 317 #define LEX_AUTOJOIN_ON_KICK 318 #define LEX_IGNORE_CAPAB 319 #define LEX_RECONN_TIMER 320 #define LEX_SASL_USERNAME 321 #define LEX_SASL_PASSWORD 322 #define LEX_SASL_MECHANISM 323 #define LEX_BOOL 324 #define LEX_INT 325 #define LEX_STRING 326 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 74 "conf.y" int number; char *string; void *list; struct tuple *tuple; #line 344 "conf.c" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONF_H_INCLUDED */ /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_LEX_IP = 3, /* LEX_IP */ YYSYMBOL_LEX_EQ = 4, /* LEX_EQ */ YYSYMBOL_LEX_PORT = 5, /* LEX_PORT */ YYSYMBOL_LEX_CSS = 6, /* LEX_CSS */ YYSYMBOL_LEX_SEMICOLON = 7, /* LEX_SEMICOLON */ YYSYMBOL_LEX_CONNECTION = 8, /* LEX_CONNECTION */ YYSYMBOL_LEX_NETWORK = 9, /* LEX_NETWORK */ YYSYMBOL_LEX_LBRA = 10, /* LEX_LBRA */ YYSYMBOL_LEX_RBRA = 11, /* LEX_RBRA */ YYSYMBOL_LEX_USER = 12, /* LEX_USER */ YYSYMBOL_LEX_NAME = 13, /* LEX_NAME */ YYSYMBOL_LEX_NICK = 14, /* LEX_NICK */ YYSYMBOL_LEX_SERVER = 15, /* LEX_SERVER */ YYSYMBOL_LEX_PASSWORD = 16, /* LEX_PASSWORD */ YYSYMBOL_LEX_SRCIP = 17, /* LEX_SRCIP */ YYSYMBOL_LEX_HOST = 18, /* LEX_HOST */ YYSYMBOL_LEX_VHOST = 19, /* LEX_VHOST */ YYSYMBOL_LEX_SOURCE_PORT = 20, /* LEX_SOURCE_PORT */ YYSYMBOL_LEX_NONE = 21, /* LEX_NONE */ YYSYMBOL_LEX_COMMENT = 22, /* LEX_COMMENT */ YYSYMBOL_LEX_BUNCH = 23, /* LEX_BUNCH */ YYSYMBOL_LEX_REALNAME = 24, /* LEX_REALNAME */ YYSYMBOL_LEX_SSL = 25, /* LEX_SSL */ YYSYMBOL_LEX_SSL_CHECK_MODE = 26, /* LEX_SSL_CHECK_MODE */ YYSYMBOL_LEX_SSL_CHECK_STORE = 27, /* LEX_SSL_CHECK_STORE */ YYSYMBOL_LEX_SSL_CLIENT_CERTFILE = 28, /* LEX_SSL_CLIENT_CERTFILE */ YYSYMBOL_LEX_CIPHERS = 29, /* LEX_CIPHERS */ YYSYMBOL_LEX_CSS_CIPHERS = 30, /* LEX_CSS_CIPHERS */ YYSYMBOL_LEX_DEFAULT_CIPHERS = 31, /* LEX_DEFAULT_CIPHERS */ YYSYMBOL_LEX_DH_PARAM = 32, /* LEX_DH_PARAM */ YYSYMBOL_LEX_CHANNEL = 33, /* LEX_CHANNEL */ YYSYMBOL_LEX_KEY = 34, /* LEX_KEY */ YYSYMBOL_LEX_LOG_ROOT = 35, /* LEX_LOG_ROOT */ YYSYMBOL_LEX_LOG_FORMAT = 36, /* LEX_LOG_FORMAT */ YYSYMBOL_LEX_LOG_LEVEL = 37, /* LEX_LOG_LEVEL */ YYSYMBOL_LEX_BACKLOG_LINES = 38, /* LEX_BACKLOG_LINES */ YYSYMBOL_LEX_BACKLOG_TIMESTAMP = 39, /* LEX_BACKLOG_TIMESTAMP */ YYSYMBOL_LEX_BACKLOG_NO_TIMESTAMP = 40, /* LEX_BACKLOG_NO_TIMESTAMP */ YYSYMBOL_LEX_BACKLOG = 41, /* LEX_BACKLOG */ YYSYMBOL_LEX_LOG = 42, /* LEX_LOG */ YYSYMBOL_LEX_LOG_SYSTEM = 43, /* LEX_LOG_SYSTEM */ YYSYMBOL_LEX_LOG_SYNC_INTERVAL = 44, /* LEX_LOG_SYNC_INTERVAL */ YYSYMBOL_LEX_FOLLOW_NICK = 45, /* LEX_FOLLOW_NICK */ YYSYMBOL_LEX_ON_CONNECT_SEND = 46, /* LEX_ON_CONNECT_SEND */ YYSYMBOL_LEX_AWAY_NICK = 47, /* LEX_AWAY_NICK */ YYSYMBOL_LEX_PID_FILE = 48, /* LEX_PID_FILE */ YYSYMBOL_LEX_WRITE_OIDENTD = 49, /* LEX_WRITE_OIDENTD */ YYSYMBOL_LEX_OIDENTD_FILE = 50, /* LEX_OIDENTD_FILE */ YYSYMBOL_LEX_IGN_FIRST_NICK = 51, /* LEX_IGN_FIRST_NICK */ YYSYMBOL_LEX_ALWAYS_BACKLOG = 52, /* LEX_ALWAYS_BACKLOG */ YYSYMBOL_LEX_BLRESET_ON_TALK = 53, /* LEX_BLRESET_ON_TALK */ YYSYMBOL_LEX_BLRESET_CONNECTION = 54, /* LEX_BLRESET_CONNECTION */ YYSYMBOL_LEX_DEFAULT_USER = 55, /* LEX_DEFAULT_USER */ YYSYMBOL_LEX_DEFAULT_NICK = 56, /* LEX_DEFAULT_NICK */ YYSYMBOL_LEX_DEFAULT_REALNAME = 57, /* LEX_DEFAULT_REALNAME */ YYSYMBOL_LEX_NO_CLIENT_AWAY_MSG = 58, /* LEX_NO_CLIENT_AWAY_MSG */ YYSYMBOL_LEX_BL_MSG_ONLY = 59, /* LEX_BL_MSG_ONLY */ YYSYMBOL_LEX_ADMIN = 60, /* LEX_ADMIN */ YYSYMBOL_LEX_BIP_USE_NOTICE = 61, /* LEX_BIP_USE_NOTICE */ YYSYMBOL_LEX_CSS_PEM = 62, /* LEX_CSS_PEM */ YYSYMBOL_LEX_AUTOJOIN_ON_KICK = 63, /* LEX_AUTOJOIN_ON_KICK */ YYSYMBOL_LEX_IGNORE_CAPAB = 64, /* LEX_IGNORE_CAPAB */ YYSYMBOL_LEX_RECONN_TIMER = 65, /* LEX_RECONN_TIMER */ YYSYMBOL_LEX_SASL_USERNAME = 66, /* LEX_SASL_USERNAME */ YYSYMBOL_LEX_SASL_PASSWORD = 67, /* LEX_SASL_PASSWORD */ YYSYMBOL_LEX_SASL_MECHANISM = 68, /* LEX_SASL_MECHANISM */ YYSYMBOL_LEX_BOOL = 69, /* LEX_BOOL */ YYSYMBOL_LEX_INT = 70, /* LEX_INT */ YYSYMBOL_LEX_STRING = 71, /* LEX_STRING */ YYSYMBOL_YYACCEPT = 72, /* $accept */ YYSYMBOL_commands = 73, /* commands */ YYSYMBOL_command = 74, /* command */ YYSYMBOL_network = 75, /* network */ YYSYMBOL_net_command = 76, /* net_command */ YYSYMBOL_user = 77, /* user */ YYSYMBOL_usr_command = 78, /* usr_command */ YYSYMBOL_connection = 79, /* connection */ YYSYMBOL_con_command = 80, /* con_command */ YYSYMBOL_channel = 81, /* channel */ YYSYMBOL_cha_command = 82, /* cha_command */ YYSYMBOL_server = 83, /* server */ YYSYMBOL_ser_command = 84 /* ser_command */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_uint8 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 239 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 72 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 13 /* YYNRULES -- Number of rules. */ #define YYNRULES 88 /* YYNSTATES -- Number of states. */ #define YYNSTATES 245 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 326 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 89, 89, 90, 94, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 110, 111, 112, 114, 117, 120, 123, 124, 127, 130, 133, 135, 138, 139, 142, 143, 144, 145, 149, 150, 153, 155, 157, 158, 160, 162, 164, 166, 168, 170, 172, 175, 178, 181, 182, 185, 188, 191, 193, 197, 198, 202, 203, 205, 206, 207, 208, 210, 212, 214, 216, 218, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 240, 241, 244, 245, 246, 249, 250, 253, 254 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "LEX_IP", "LEX_EQ", "LEX_PORT", "LEX_CSS", "LEX_SEMICOLON", "LEX_CONNECTION", "LEX_NETWORK", "LEX_LBRA", "LEX_RBRA", "LEX_USER", "LEX_NAME", "LEX_NICK", "LEX_SERVER", "LEX_PASSWORD", "LEX_SRCIP", "LEX_HOST", "LEX_VHOST", "LEX_SOURCE_PORT", "LEX_NONE", "LEX_COMMENT", "LEX_BUNCH", "LEX_REALNAME", "LEX_SSL", "LEX_SSL_CHECK_MODE", "LEX_SSL_CHECK_STORE", "LEX_SSL_CLIENT_CERTFILE", "LEX_CIPHERS", "LEX_CSS_CIPHERS", "LEX_DEFAULT_CIPHERS", "LEX_DH_PARAM", "LEX_CHANNEL", "LEX_KEY", "LEX_LOG_ROOT", "LEX_LOG_FORMAT", "LEX_LOG_LEVEL", "LEX_BACKLOG_LINES", "LEX_BACKLOG_TIMESTAMP", "LEX_BACKLOG_NO_TIMESTAMP", "LEX_BACKLOG", "LEX_LOG", "LEX_LOG_SYSTEM", "LEX_LOG_SYNC_INTERVAL", "LEX_FOLLOW_NICK", "LEX_ON_CONNECT_SEND", "LEX_AWAY_NICK", "LEX_PID_FILE", "LEX_WRITE_OIDENTD", "LEX_OIDENTD_FILE", "LEX_IGN_FIRST_NICK", "LEX_ALWAYS_BACKLOG", "LEX_BLRESET_ON_TALK", "LEX_BLRESET_CONNECTION", "LEX_DEFAULT_USER", "LEX_DEFAULT_NICK", "LEX_DEFAULT_REALNAME", "LEX_NO_CLIENT_AWAY_MSG", "LEX_BL_MSG_ONLY", "LEX_ADMIN", "LEX_BIP_USE_NOTICE", "LEX_CSS_PEM", "LEX_AUTOJOIN_ON_KICK", "LEX_IGNORE_CAPAB", "LEX_RECONN_TIMER", "LEX_SASL_USERNAME", "LEX_SASL_PASSWORD", "LEX_SASL_MECHANISM", "LEX_BOOL", "LEX_INT", "LEX_STRING", "$accept", "commands", "command", "network", "net_command", "user", "usr_command", "connection", "con_command", "channel", "cha_command", "server", "ser_command", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #define YYPACT_NINF (-7) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-1) #define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -7, 0, -7, -2, 6, 7, -6, 3, 12, 14, 16, 17, 18, 19, 21, 23, 24, 30, 41, 42, 47, 51, 52, 53, 54, 56, 57, 59, 66, 1, 2, 8, 11, -7, -7, 5, 15, 20, 22, 25, 28, 29, 32, 26, 35, 36, 39, 44, 38, 48, 40, 60, 61, 62, 45, 50, -7, -7, -7, -7, 4, 99, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 68, 67, 78, 79, 77, 75, -7, 83, 85, 86, 88, 90, 120, 124, 128, 129, 130, 131, 132, 137, 138, 139, 140, 141, 142, 143, 76, -7, 80, 91, -7, -7, 92, 93, 94, 95, 96, 87, 97, 100, 101, 102, 103, 104, 105, 106, 107, 110, 111, 112, -7, -7, -4, -7, -7, 55, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 144, -7, 157, 167, 171, -7, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 193, 194, 195, 196, 197, 198, 199, 133, 119, -7, 134, 136, 145, 146, 147, 148, 150, 151, 152, -7, 135, 155, 154, 156, 159, 158, 161, 162, 163, 164, 165, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 13, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 204, 205, 206, 207, 166, 168, 169, -7, -7, -7, -7 }; /* 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_int8 yydefact[] = { 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 9, 10, 0, 0, 12, 13, 14, 4, 5, 6, 21, 22, 23, 24, 15, 16, 17, 18, 19, 20, 27, 25, 26, 11, 7, 28, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 31, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 32, 0, 33, 34, 0, 38, 39, 42, 43, 44, 48, 49, 50, 51, 55, 52, 53, 45, 46, 47, 54, 40, 41, 0, 35, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 88, 87, 60, 63, 59, 62, 65, 69, 70, 64, 79, 0, 61, 72, 77, 71, 73, 78, 74, 75, 66, 67, 68, 76, 0, 0, 0, 0, 0, 0, 0, 81, 82, 83, 84 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_uint8 yydefgoto[] = { 0, 1, 29, 60, 88, 61, 109, 139, 184, 221, 237, 136, 161 }; /* 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_uint8 yytable[] = { 2, 158, 30, 3, 33, 4, 5, 159, 56, 6, 31, 32, 7, 34, 160, 83, 35, 84, 36, 85, 37, 38, 39, 40, 233, 41, 234, 42, 43, 86, 8, 9, 10, 87, 44, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 45, 46, 235, 21, 22, 23, 47, 24, 25, 236, 48, 49, 50, 51, 26, 52, 53, 27, 54, 162, 28, 163, 164, 165, 166, 55, 167, 110, 57, 168, 169, 62, 111, 58, 170, 59, 171, 112, 113, 114, 115, 63, 116, 172, 117, 118, 64, 119, 65, 120, 70, 66, 173, 67, 68, 174, 175, 176, 69, 71, 72, 177, 89, 73, 75, 90, 77, 91, 178, 74, 92, 81, 76, 179, 180, 82, 181, 182, 183, 121, 93, 94, 95, 122, 78, 79, 80, 123, 124, 125, 126, 127, 96, 97, 98, 99, 128, 129, 130, 131, 132, 133, 135, 185, 137, 134, 100, 101, 102, 103, 104, 105, 145, 106, 107, 108, 186, 138, 140, 141, 142, 143, 144, 146, 147, 148, 149, 150, 151, 187, 188, 152, 153, 154, 155, 156, 157, 189, 190, 191, 192, 193, 194, 195, 196, 211, 198, 199, 200, 201, 202, 197, 203, 204, 205, 206, 207, 208, 210, 222, 212, 209, 213, 238, 239, 240, 0, 0, 0, 241, 0, 214, 215, 216, 217, 218, 0, 219, 220, 223, 224, 0, 225, 226, 227, 228, 229, 0, 0, 230, 231, 232, 242, 244, 243 }; static const yytype_int8 yycheck[] = { 0, 5, 4, 3, 10, 5, 6, 11, 7, 9, 4, 4, 12, 10, 18, 11, 4, 13, 4, 15, 4, 4, 4, 4, 11, 4, 13, 4, 4, 25, 30, 31, 32, 29, 4, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 4, 4, 34, 48, 49, 50, 4, 52, 53, 41, 4, 4, 4, 4, 59, 4, 4, 62, 4, 9, 65, 11, 12, 13, 14, 4, 16, 4, 71, 19, 20, 71, 10, 70, 24, 69, 26, 4, 4, 7, 10, 71, 4, 33, 4, 4, 71, 4, 71, 4, 69, 71, 42, 70, 70, 45, 46, 47, 71, 69, 69, 51, 8, 69, 71, 11, 71, 13, 58, 70, 16, 71, 69, 63, 64, 70, 66, 67, 68, 4, 26, 27, 28, 4, 69, 69, 69, 4, 4, 4, 4, 4, 38, 39, 40, 41, 4, 4, 4, 4, 4, 4, 71, 4, 69, 7, 52, 53, 54, 55, 56, 57, 70, 59, 60, 61, 4, 71, 71, 71, 71, 71, 71, 71, 69, 69, 69, 69, 69, 7, 4, 71, 71, 71, 69, 69, 69, 4, 4, 4, 4, 4, 4, 4, 4, 71, 4, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, 70, 69, 71, 7, 71, 4, 4, 4, -1, -1, -1, 7, -1, 71, 71, 71, 71, 70, -1, 71, 71, 69, 71, -1, 71, 69, 71, 69, 69, -1, -1, 71, 71, 71, 71, 69, 71 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 73, 0, 3, 5, 6, 9, 12, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 48, 49, 50, 52, 53, 59, 62, 65, 74, 4, 4, 4, 10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 71, 70, 69, 75, 77, 71, 71, 71, 71, 71, 70, 70, 71, 69, 69, 69, 69, 70, 71, 69, 71, 69, 69, 69, 71, 70, 11, 13, 15, 25, 29, 76, 8, 11, 13, 16, 26, 27, 28, 38, 39, 40, 41, 52, 53, 54, 55, 56, 57, 59, 60, 61, 78, 4, 10, 4, 4, 7, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 71, 83, 69, 71, 79, 71, 71, 71, 71, 71, 70, 71, 69, 69, 69, 69, 69, 71, 71, 71, 69, 69, 69, 5, 11, 18, 84, 9, 11, 12, 13, 14, 16, 19, 20, 24, 26, 33, 42, 45, 46, 47, 51, 58, 63, 64, 66, 67, 68, 80, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 70, 71, 71, 71, 71, 71, 71, 71, 70, 71, 71, 81, 69, 69, 71, 71, 69, 71, 69, 69, 71, 71, 71, 11, 13, 34, 41, 82, 4, 4, 4, 7, 71, 71, 69 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 72, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 76, 76, 76, 76, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 82, 82, 82, 83, 83, 84, 84 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 0, 3, 3, 3, 3, 4, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 0, 3, 3, 3, 3, 0, 3, 3, 3 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YY_USE (yyoutput); if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Discard the shifted token. */ yychar = YYEMPTY; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* commands: %empty */ #line 89 "conf.y" { (yyval.list) = root_list = list_new(NULL); } #line 1563 "conf.c" break; case 3: /* commands: commands command LEX_SEMICOLON */ #line 90 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1569 "conf.c" break; case 4: /* command: LEX_LOG_ROOT LEX_EQ LEX_STRING */ #line 94 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_LOG_ROOT, (yyvsp[0].string)); } #line 1575 "conf.c" break; case 5: /* command: LEX_LOG_FORMAT LEX_EQ LEX_STRING */ #line 95 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_LOG_FORMAT, (yyvsp[0].string)); } #line 1582 "conf.c" break; case 6: /* command: LEX_LOG_LEVEL LEX_EQ LEX_INT */ #line 97 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_LOG_LEVEL, (yyvsp[0].number)); } #line 1588 "conf.c" break; case 7: /* command: LEX_RECONN_TIMER LEX_EQ LEX_INT */ #line 98 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_RECONN_TIMER, (yyvsp[0].number)); } #line 1594 "conf.c" break; case 8: /* command: LEX_IP LEX_EQ LEX_STRING */ #line 99 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_IP, (yyvsp[0].string)); } #line 1600 "conf.c" break; case 9: /* command: LEX_PORT LEX_EQ LEX_INT */ #line 100 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_PORT, (yyvsp[0].number)); } #line 1606 "conf.c" break; case 10: /* command: LEX_CSS LEX_EQ LEX_BOOL */ #line 101 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_CSS, (yyvsp[0].number)); } #line 1612 "conf.c" break; case 11: /* command: LEX_CSS_PEM LEX_EQ LEX_STRING */ #line 102 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_CSS_PEM, (yyvsp[0].string)); } #line 1618 "conf.c" break; case 12: /* command: LEX_CSS_CIPHERS LEX_EQ LEX_STRING */ #line 103 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_CSS_CIPHERS, (yyvsp[0].string)); } #line 1624 "conf.c" break; case 13: /* command: LEX_DEFAULT_CIPHERS LEX_EQ LEX_STRING */ #line 104 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_CIPHERS, (yyvsp[0].string)); } #line 1630 "conf.c" break; case 14: /* command: LEX_DH_PARAM LEX_EQ LEX_STRING */ #line 105 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_DH_PARAM, (yyvsp[0].string)); } #line 1636 "conf.c" break; case 15: /* command: LEX_LOG LEX_EQ LEX_BOOL */ #line 106 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_LOG, (yyvsp[0].number)); } #line 1642 "conf.c" break; case 16: /* command: LEX_LOG_SYSTEM LEX_EQ LEX_BOOL */ #line 107 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_LOG_SYSTEM, (yyvsp[0].number)); } #line 1648 "conf.c" break; case 17: /* command: LEX_LOG_SYNC_INTERVAL LEX_EQ LEX_INT */ #line 108 "conf.y" { (yyval.tuple) = tuple_i_new( LEX_LOG_SYNC_INTERVAL, (yyvsp[0].number)); } #line 1655 "conf.c" break; case 18: /* command: LEX_PID_FILE LEX_EQ LEX_STRING */ #line 110 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_PID_FILE, (yyvsp[0].string)); } #line 1661 "conf.c" break; case 19: /* command: LEX_WRITE_OIDENTD LEX_EQ LEX_BOOL */ #line 111 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_WRITE_OIDENTD, (yyvsp[0].number)); } #line 1667 "conf.c" break; case 20: /* command: LEX_OIDENTD_FILE LEX_EQ LEX_STRING */ #line 112 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_OIDENTD_FILE, (yyvsp[0].string)); } #line 1673 "conf.c" break; case 21: /* command: LEX_BACKLOG_LINES LEX_EQ LEX_INT */ #line 114 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_LINES, (yyvsp[0].number)); } #line 1681 "conf.c" break; case 22: /* command: LEX_BACKLOG_TIMESTAMP LEX_EQ LEX_STRING */ #line 117 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_BACKLOG_TIMESTAMP, (yyvsp[0].string)); } #line 1689 "conf.c" break; case 23: /* command: LEX_BACKLOG_NO_TIMESTAMP LEX_EQ LEX_BOOL */ #line 120 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, (yyvsp[0].number)); } #line 1697 "conf.c" break; case 24: /* command: LEX_BACKLOG LEX_EQ LEX_BOOL */ #line 123 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 1703 "conf.c" break; case 25: /* command: LEX_BLRESET_ON_TALK LEX_EQ LEX_BOOL */ #line 124 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BLRESET_ON_TALK, (yyvsp[0].number)); } #line 1711 "conf.c" break; case 26: /* command: LEX_BL_MSG_ONLY LEX_EQ LEX_BOOL */ #line 127 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BL_MSG_ONLY, (yyvsp[0].number)); } #line 1719 "conf.c" break; case 27: /* command: LEX_ALWAYS_BACKLOG LEX_EQ LEX_BOOL */ #line 130 "conf.y" { (yyval.tuple) = tuple_i_new( LEX_ALWAYS_BACKLOG, (yyvsp[0].number)); } #line 1726 "conf.c" break; case 28: /* command: LEX_NETWORK LEX_LBRA network LEX_RBRA */ #line 133 "conf.y" { (yyval.tuple) = tuple_l_new(LEX_NETWORK, (yyvsp[-1].list)); } #line 1733 "conf.c" break; case 29: /* command: LEX_USER LEX_LBRA user LEX_RBRA */ #line 135 "conf.y" { (yyval.tuple) = tuple_l_new(LEX_USER, (yyvsp[-1].list)); } #line 1739 "conf.c" break; case 30: /* network: %empty */ #line 138 "conf.y" { (yyval.list) = list_new(NULL); } #line 1745 "conf.c" break; case 31: /* network: network net_command LEX_SEMICOLON */ #line 139 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1751 "conf.c" break; case 32: /* net_command: LEX_NAME LEX_EQ LEX_STRING */ #line 142 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1757 "conf.c" break; case 33: /* net_command: LEX_SSL LEX_EQ LEX_BOOL */ #line 143 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_SSL, (yyvsp[0].number)); } #line 1763 "conf.c" break; case 34: /* net_command: LEX_CIPHERS LEX_EQ LEX_STRING */ #line 144 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_CIPHERS, (yyvsp[0].string)); } #line 1769 "conf.c" break; case 35: /* net_command: LEX_SERVER LEX_LBRA server LEX_RBRA */ #line 145 "conf.y" { (yyval.tuple) = tuple_l_new(LEX_SERVER, (yyvsp[-1].list)); } #line 1776 "conf.c" break; case 36: /* user: %empty */ #line 149 "conf.y" { (yyval.list) = list_new(NULL); } #line 1782 "conf.c" break; case 37: /* user: user usr_command LEX_SEMICOLON */ #line 150 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1788 "conf.c" break; case 38: /* usr_command: LEX_NAME LEX_EQ LEX_STRING */ #line 153 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1795 "conf.c" break; case 39: /* usr_command: LEX_PASSWORD LEX_EQ LEX_STRING */ #line 155 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_PASSWORD, (yyvsp[0].string)); } #line 1802 "conf.c" break; case 40: /* usr_command: LEX_ADMIN LEX_EQ LEX_BOOL */ #line 157 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_ADMIN, (yyvsp[0].number)); } #line 1808 "conf.c" break; case 41: /* usr_command: LEX_BIP_USE_NOTICE LEX_EQ LEX_BOOL */ #line 158 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BIP_USE_NOTICE, (yyvsp[0].number)); } #line 1815 "conf.c" break; case 42: /* usr_command: LEX_SSL_CHECK_MODE LEX_EQ LEX_STRING */ #line 160 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_MODE, (yyvsp[0].string)); } #line 1822 "conf.c" break; case 43: /* usr_command: LEX_SSL_CHECK_STORE LEX_EQ LEX_STRING */ #line 162 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_STORE, (yyvsp[0].string)); } #line 1829 "conf.c" break; case 44: /* usr_command: LEX_SSL_CLIENT_CERTFILE LEX_EQ LEX_STRING */ #line 164 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SSL_CLIENT_CERTFILE, (yyvsp[0].string)); } #line 1836 "conf.c" break; case 45: /* usr_command: LEX_DEFAULT_USER LEX_EQ LEX_STRING */ #line 166 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_USER, (yyvsp[0].string)); } #line 1843 "conf.c" break; case 46: /* usr_command: LEX_DEFAULT_NICK LEX_EQ LEX_STRING */ #line 168 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_NICK, (yyvsp[0].string)); } #line 1850 "conf.c" break; case 47: /* usr_command: LEX_DEFAULT_REALNAME LEX_EQ LEX_STRING */ #line 170 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_REALNAME, (yyvsp[0].string)); } #line 1857 "conf.c" break; case 48: /* usr_command: LEX_BACKLOG_LINES LEX_EQ LEX_INT */ #line 172 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_LINES, (yyvsp[0].number)); } #line 1865 "conf.c" break; case 49: /* usr_command: LEX_BACKLOG_TIMESTAMP LEX_EQ LEX_STRING */ #line 175 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_BACKLOG_TIMESTAMP, (yyvsp[0].string)); } #line 1873 "conf.c" break; case 50: /* usr_command: LEX_BACKLOG_NO_TIMESTAMP LEX_EQ LEX_BOOL */ #line 178 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, (yyvsp[0].number)); } #line 1881 "conf.c" break; case 51: /* usr_command: LEX_BACKLOG LEX_EQ LEX_BOOL */ #line 181 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 1887 "conf.c" break; case 52: /* usr_command: LEX_BLRESET_ON_TALK LEX_EQ LEX_BOOL */ #line 182 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BLRESET_ON_TALK, (yyvsp[0].number)); } #line 1895 "conf.c" break; case 53: /* usr_command: LEX_BLRESET_CONNECTION LEX_EQ LEX_BOOL */ #line 185 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BLRESET_CONNECTION, (yyvsp[0].number)); } #line 1903 "conf.c" break; case 54: /* usr_command: LEX_BL_MSG_ONLY LEX_EQ LEX_BOOL */ #line 188 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BL_MSG_ONLY, (yyvsp[0].number)); } #line 1911 "conf.c" break; case 55: /* usr_command: LEX_ALWAYS_BACKLOG LEX_EQ LEX_BOOL */ #line 191 "conf.y" { (yyval.tuple) = tuple_i_new( LEX_ALWAYS_BACKLOG, (yyvsp[0].number)); } #line 1918 "conf.c" break; case 56: /* usr_command: LEX_CONNECTION LEX_LBRA connection LEX_RBRA */ #line 193 "conf.y" { (yyval.tuple) = tuple_l_new(LEX_CONNECTION, (yyvsp[-1].list)); } #line 1925 "conf.c" break; case 57: /* connection: %empty */ #line 197 "conf.y" { (yyval.list) = list_new(NULL); } #line 1931 "conf.c" break; case 58: /* connection: connection con_command LEX_SEMICOLON */ #line 198 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1938 "conf.c" break; case 59: /* con_command: LEX_NAME LEX_EQ LEX_STRING */ #line 202 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1944 "conf.c" break; case 60: /* con_command: LEX_NETWORK LEX_EQ LEX_STRING */ #line 203 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NETWORK, (yyvsp[0].string)); } #line 1951 "conf.c" break; case 61: /* con_command: LEX_LOG LEX_EQ LEX_BOOL */ #line 205 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_LOG, (yyvsp[0].number)); } #line 1957 "conf.c" break; case 62: /* con_command: LEX_NICK LEX_EQ LEX_STRING */ #line 206 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NICK, (yyvsp[0].string)); } #line 1963 "conf.c" break; case 63: /* con_command: LEX_USER LEX_EQ LEX_STRING */ #line 207 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_USER, (yyvsp[0].string)); } #line 1969 "conf.c" break; case 64: /* con_command: LEX_REALNAME LEX_EQ LEX_STRING */ #line 208 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_REALNAME, (yyvsp[0].string)); } #line 1976 "conf.c" break; case 65: /* con_command: LEX_PASSWORD LEX_EQ LEX_STRING */ #line 210 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_PASSWORD, (yyvsp[0].string)); } #line 1983 "conf.c" break; case 66: /* con_command: LEX_SASL_USERNAME LEX_EQ LEX_STRING */ #line 212 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SASL_USERNAME, (yyvsp[0].string)); } #line 1990 "conf.c" break; case 67: /* con_command: LEX_SASL_PASSWORD LEX_EQ LEX_STRING */ #line 214 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SASL_PASSWORD, (yyvsp[0].string)); } #line 1997 "conf.c" break; case 68: /* con_command: LEX_SASL_MECHANISM LEX_EQ LEX_STRING */ #line 216 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SASL_MECHANISM, (yyvsp[0].string)); } #line 2004 "conf.c" break; case 69: /* con_command: LEX_VHOST LEX_EQ LEX_STRING */ #line 218 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_VHOST, (yyvsp[0].string)); } #line 2010 "conf.c" break; case 70: /* con_command: LEX_SOURCE_PORT LEX_EQ LEX_INT */ #line 219 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_SOURCE_PORT, (yyvsp[0].number)); } #line 2017 "conf.c" break; case 71: /* con_command: LEX_AWAY_NICK LEX_EQ LEX_STRING */ #line 221 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_AWAY_NICK, (yyvsp[0].string)); } #line 2024 "conf.c" break; case 72: /* con_command: LEX_FOLLOW_NICK LEX_EQ LEX_BOOL */ #line 223 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_FOLLOW_NICK, (yyvsp[0].number)); } #line 2031 "conf.c" break; case 73: /* con_command: LEX_IGN_FIRST_NICK LEX_EQ LEX_BOOL */ #line 225 "conf.y" { (yyval.tuple) = tuple_i_new( LEX_IGN_FIRST_NICK, (yyvsp[0].number)); } #line 2038 "conf.c" break; case 74: /* con_command: LEX_AUTOJOIN_ON_KICK LEX_EQ LEX_BOOL */ #line 227 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_AUTOJOIN_ON_KICK, (yyvsp[0].number)); } #line 2045 "conf.c" break; case 75: /* con_command: LEX_IGNORE_CAPAB LEX_EQ LEX_BOOL */ #line 229 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_IGNORE_CAPAB, (yyvsp[0].number)); } #line 2052 "conf.c" break; case 76: /* con_command: LEX_CHANNEL LEX_LBRA channel LEX_RBRA */ #line 231 "conf.y" { (yyval.tuple) = tuple_l_new( LEX_CHANNEL, (yyvsp[-1].list)); } #line 2059 "conf.c" break; case 77: /* con_command: LEX_ON_CONNECT_SEND LEX_EQ LEX_STRING */ #line 233 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_ON_CONNECT_SEND, (yyvsp[0].string)); } #line 2066 "conf.c" break; case 78: /* con_command: LEX_NO_CLIENT_AWAY_MSG LEX_EQ LEX_STRING */ #line 235 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_NO_CLIENT_AWAY_MSG, (yyvsp[0].string)); } #line 2073 "conf.c" break; case 79: /* con_command: LEX_SSL_CHECK_MODE LEX_EQ LEX_STRING */ #line 237 "conf.y" { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_MODE, (yyvsp[0].string)); } #line 2080 "conf.c" break; case 80: /* channel: %empty */ #line 240 "conf.y" { (yyval.list) = list_new(NULL); } #line 2086 "conf.c" break; case 81: /* channel: channel cha_command LEX_SEMICOLON */ #line 241 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 2092 "conf.c" break; case 82: /* cha_command: LEX_NAME LEX_EQ LEX_STRING */ #line 244 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 2098 "conf.c" break; case 83: /* cha_command: LEX_KEY LEX_EQ LEX_STRING */ #line 245 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_KEY, (yyvsp[0].string)); } #line 2104 "conf.c" break; case 84: /* cha_command: LEX_BACKLOG LEX_EQ LEX_BOOL */ #line 246 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 2110 "conf.c" break; case 85: /* server: %empty */ #line 249 "conf.y" { (yyval.list) = list_new(NULL); } #line 2116 "conf.c" break; case 86: /* server: server ser_command LEX_SEMICOLON */ #line 250 "conf.y" { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 2122 "conf.c" break; case 87: /* ser_command: LEX_HOST LEX_EQ LEX_STRING */ #line 253 "conf.y" { (yyval.tuple) = tuple_s_new(LEX_HOST, (yyvsp[0].string)); } #line 2128 "conf.c" break; case 88: /* ser_command: LEX_PORT LEX_EQ LEX_INT */ #line 254 "conf.y" { (yyval.tuple) = tuple_i_new(LEX_PORT, (yyvsp[0].number)); } #line 2134 "conf.c" break; #line 2138 "conf.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (YY_("syntax error")); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturnlab; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturnlab; /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } bip-0.9.3/src/log.h0000664000175000017500000000655314212375475010764 00000000000000/* * $Id: log.h,v 1.26 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2004,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef LOG_H #define LOG_H #define _XOPEN_SOURCE 500 #include #include #include #include #include #include #include #include "util.h" #define MAX_PATH_LEN 1024 #define LOGLINE_MAXLEN 2048 struct list; typedef struct logfile { FILE *file; char *filename; char *canonical_filename; struct tm last_log; size_t len; } logfile_t; typedef struct logstore { char *name; list_t file_group; int skip_advance; list_t *memlog; int memc; int track_backlog; list_iterator_t file_it; long file_offset; } logstore_t; typedef struct log { hash_t logfgs; char *network; char *buffer; int connected; int backlogging; int lastfile_seeked; int log_to_file; struct bipuser *user; } log_t; log_t *log_new(struct bipuser *user, const char *network); void logdata_free(log_t *logdata); void log_join(log_t *logdata, const char *ircmask, const char *channel); void log_part(log_t *logdata, const char *ircmask, const char *channel, const char *message); void log_kick(log_t *logdata, const char *ircmask, const char *channel, const char *who, const char *message); void log_quit(log_t *logdata, const char *ircmask, const char *channel, const char *message); void log_nick(log_t *logdata, const char *ircmask, const char *channel, const char *newnick); void log_privmsg(log_t *logdata, const char *ircmask, const char *destination, const char *message); void log_notice(log_t *logdata, const char *ircmask, const char *channel, const char *message); void log_cli_privmsg(log_t *logdata, const char *ircmask, const char *destination, const char *message); void log_cli_notice(log_t *logdata, const char *ircmask, const char *channel, const char *message); void log_write(log_t *logdata, const char *str, const char *destination); void log_mode(log_t *logdata, const char *ircmask, const char *channel, const char *modes, array_t *mode_args); void log_topic(log_t *logdata, const char *ircmask, const char *channel, const char *message); void log_init_topic(log_t *logdata, const char *channel, const char *message); void log_init_topic_time(log_t *logdata, const char *channel, const char *who, const char *when); void log_connected(log_t *logdata); void log_disconnected(log_t *logdata); void log_ping_timeout(log_t *logdata); void log_client_disconnected(log_t *logdata); void log_client_connected(log_t *logdata); int log_has_backlog(log_t *logdata, const char *destination); void log_flush_all(void); void log_client_none_connected(log_t *logdata); void log_reset_all(log_t *logdata); void log_free(log_t *log); int check_dir(char *filename, int is_fatal); void log_reset_store(log_t *log, const char *storename); void log_drop(log_t *log, const char *storename); list_t *log_backlogs(log_t *log); list_t *backlog_lines(log_t *log, const char *bl, const char *cli_nick, int hours); #endif bip-0.9.3/src/bip.c0000664000175000017500000016610714212375475010752 00000000000000/* * $Id: bip.c,v 1.39 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "irc.h" #include "conf.h" #include "path_util.h" #include "tuple.h" #include "log.h" #include "bip.h" #include "line.h" #include "defaults.h" #define S_CONF "bip.conf" int sighup = 0; char *conf_log_root; char *conf_log_format; int conf_log_level; char *conf_ip; unsigned short conf_port; int conf_css; #ifdef HAVE_LIBSSL char *conf_ssl_certfile; char *conf_client_ciphers; char *conf_client_dh_file; char *conf_server_default_ciphers; #endif int conf_daemonize; char *conf_pid_file; char *conf_biphome; int conf_reconn_timer; /* log options, for sure the trickiest :) */ int conf_log = DEFAULT_LOG; int conf_log_system = DEFAULT_LOG_SYSTEM; int conf_log_sync_interval = DEFAULT_LOG_SYNC_INTERVAL; bip_t *_bip; FILE *conf_global_log_file; list_t *parse_conf(FILE *file, int *err); void conf_die(bip_t *bip, char *fmt, ...); static char *get_tuple_pvalue(list_t *tuple_l, int lex); void bip_notify(struct link_client *ic, char *fmt, ...); void adm_list_connections(struct link_client *ic, struct bipuser *bu); void free_conf(list_t *l); static void hash_binary(char *hex, unsigned char **password, unsigned int *seed) { unsigned char *md5; unsigned int buf; int i; if (strlen(hex) != 40) fatal("Incorrect password format %s\n", hex); md5 = bip_malloc((size_t)20); for (i = 0; i < 20; i++) { sscanf(hex + 2 * i, "%02x", &buf); // conversion from ‘unsigned int’ to ‘unsigned char’ may change value // we're parsing a text (hex) so buf won't ever be something else than a char #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" md5[i] = buf; #pragma GCC diagnostic pop } *seed = 0; sscanf(hex, "%02x", &buf); *seed |= buf << 24; sscanf(hex + 2, "%02x", &buf); *seed |= buf << 16; sscanf(hex + 2 * 2, "%02x", &buf); *seed |= buf << 8; sscanf(hex + 2 * 3, "%02x", &buf); *seed |= buf; MAYFREE(*password); *password = md5; } static int add_server(bip_t *bip, struct server *s, list_t *data) { struct tuple *t; s->port = 6667; /* default port */ while ((t = list_remove_first(data))) { switch (t->type) { case LEX_HOST: MOVE_STRING(s->host, t->pdata); break; case LEX_PORT: s->port = (unsigned short)t->ndata; break; default: fatal("Config error in server block (%d)", t->type); } if (t->tuple_type == TUPLE_STR && t->pdata) free(t->pdata); free(t); } if (!s->host) { free(s); conf_die(bip, "Server conf: host not set"); return 0; } return 1; } #define ERRBUFSZ 128 extern list_t *root_list; extern int yyparse(void); void conf_die(bip_t *bip, char *fmt, ...) { va_list ap; size_t size = ERRBUFSZ; int n; char *error = bip_malloc(size); for (;;) { va_start(ap, fmt); n = vsnprintf(error, size, fmt, ap); va_end(ap); if (n > -1 && (unsigned int)n < size) { list_add_last(&bip->errors, error); break; } if (n > -1) size = (unsigned int)n + 1; else size *= 2; error = bip_realloc(error, size); } va_start(ap, fmt); _mylog(LOG_ERROR, fmt, ap); va_end(ap); } /* RACE CONDITION! */ int do_pid_stuff(void) { char hname[512]; FILE *f; int fd; // size is conf_pid_file + hname max + %ld max + two '.'. size_t longpath_max = strlen(conf_pid_file) + 512 + 3 + 20; char *longpath = bip_malloc(longpath_max + 1); try_again: fd = -1; f = fopen(conf_pid_file, "r"); if (f) goto pid_is_there; if (gethostname(hname, (size_t)511) == -1) fatal("%s %s", "gethostname", strerror(errno)); hname[511] = 0; snprintf(longpath, longpath_max - 1, "%s.%s.%ld", conf_pid_file, hname, (long)getpid()); longpath[longpath_max] = 0; if ((fd = open(longpath, O_CREAT | O_WRONLY, S_IWUSR | S_IRUSR)) == -1) fatal("Cannot write to PID file (%s) %s", longpath, strerror(errno)); if (link(longpath, conf_pid_file) == -1) { struct stat buf; if (stat(longpath, &buf) == -1) { if (buf.st_nlink != 2) { f = fopen(conf_pid_file, "r"); goto pid_is_there; } } } unlink(longpath); free(longpath); return fd; pid_is_there : { pid_t pid; size_t p; if (fd != -1) close(fd); if (f) { int c = fscanf(f, "%zu", (size_t *)&p); fclose(f); pid = (pid_t)p; if (c != 1 || p == 0) { mylog(LOG_INFO, "pid file found but invalid " "data inside. Continuing...\n"); if (unlink(conf_pid_file)) { fatal("Cannot delete pid file '%s', " "check permissions.\n", conf_pid_file); } goto try_again; } } else pid = 0; int kr = kill(pid, 0); if (kr == -1 && (errno == ESRCH || errno == EPERM)) { /* that's not bip! */ if (unlink(conf_pid_file)) { fatal("Cannot delete pid file '%s', check " "permissions.\n", conf_pid_file); } goto try_again; } if (pid) mylog(LOG_INFO, "pid file found (pid %ld).", pid); mylog(LOG_FATAL, "Another instance of bip is certainly running."); mylog(LOG_FATAL, "If you are sure this is not the case remove" " %s.", conf_pid_file); exit(2); } free(longpath); return 0; } void reload_config(int i) { (void)i; sighup = 1; _bip->reloading_client = NULL; } void rlimit_cpu_reached(int i) { (void)i; mylog(LOG_WARN, "This process has reached the CPU time usage limit. " "It means bip will be killed by the Operating System soon."); } void rlimit_bigfile_reached(int i) { (void)i; mylog(LOG_WARN, "A file has reached the max size this process is " "allowed to create. The file will not be written correctly, " "an error message should follow. This is not fatal."); } void bad_quit(int i) { list_iterator_t it; for (list_it_init(&_bip->link_list, &it); list_it_item(&it); list_it_next(&it)) { struct link *l = list_it_item(&it); struct link_server *ls = l->l_server; if (ls && l->s_state == IRCS_CONNECTED) { write_line_fast(CONN(ls), "QUIT :Coyote finally " "caught me\r\n"); } } unlink(conf_pid_file); exit(i); } static int add_network(bip_t *bip, list_t *data) { struct tuple *t; struct network *n; int i; int r; char *name = get_tuple_pvalue(data, LEX_NAME); if (name == NULL) { conf_die(bip, "Network with no name"); return 0; } n = hash_get(&bip->networks, name); if (n) { for (i = 0; i < n->serverc; i++) free(n->serverv[i].host); free(n->serverv); n->serverv = NULL; n->serverc = 0; } else { n = bip_calloc(sizeof(struct network), (size_t)1); hash_insert(&bip->networks, name, n); } while ((t = list_remove_first(data))) { switch (t->type) { case LEX_NAME: MOVE_STRING(n->name, t->pdata); break; #ifdef HAVE_LIBSSL case LEX_SSL: n->ssl = t->ndata; break; case LEX_CIPHERS: MOVE_STRING(n->ciphers, t->pdata); break; #endif case LEX_SERVER: if (n->serverc < 0) { conf_die(bip, "internal error in network statement"); return 0; } n->serverv = bip_realloc( n->serverv, (unsigned int)(n->serverc + 1) * sizeof(struct server)); n->serverc++; memset(&n->serverv[n->serverc - 1], 0, sizeof(struct server)); r = add_server(bip, &n->serverv[n->serverc - 1], t->pdata); if (!r) { n->serverc--; return 0; } free(t->pdata); t->pdata = NULL; break; default: conf_die(bip, "unknown keyword in network statement"); return 0; break; } if (t->tuple_type == TUPLE_STR && t->pdata) free(t->pdata); free(t); } #ifdef HAVE_LIBSSL if (!n->ciphers) { n->ciphers = conf_server_default_ciphers; } #endif if (n->serverc == 0) { conf_die(bip, "No server in network: %s", n->name); hash_remove_if_exists(&bip->networks, name); free(n->name); free(n); n = NULL; return 0; } return 1; } void adm_bip_delconn(bip_t *bip, struct link_client *ic, const char *conn_name) { struct bipuser *user = LINK(ic)->user; struct link *l; if (!(l = hash_get(&user->connections, conn_name))) { bip_notify(ic, "cannot find this connection"); return; } bip_notify(ic, "deleting"); link_kill(bip, l); } void adm_bip_addconn(bip_t *bip, struct link_client *ic, const char *conn_name, const char *network_name) { struct bipuser *user = LINK(ic)->user; struct network *network; /* check name uniqueness */ if (hash_get(&user->connections, conn_name)) { bip_notify(ic, "connection name already exists for this user."); return; } /* check we know about this network */ network = hash_get(&bip->networks, network_name); if (!network) { bip_notify(ic, "no such network name"); return; } struct link *l; l = irc_link_new(); l->name = bip_strdup(conn_name); hash_insert(&user->connections, conn_name, l); list_add_last(&bip->link_list, l); l->user = user; l->network = network; l->log = log_new(user, conn_name); #ifdef HAVE_LIBSSL l->ssl_check_mode = user->ssl_check_mode; l->untrusted_certs = sk_X509_new_null(); #endif #define SCOPY(member) \ l->member = (LINK(ic)->member ? bip_strdup(LINK(ic)->member) : NULL) #define ICOPY(member) l->member = LINK(ic)->member SCOPY(connect_nick); SCOPY(username); SCOPY(realname); /* we don't copy server password */ SCOPY(vhost); ICOPY(follow_nick); ICOPY(ignore_first_nick); SCOPY(away_nick); SCOPY(no_client_away_msg); /* we don't copy on_connect_send */ #ifdef HAVE_LIBSSL ICOPY(ssl_check_mode); #endif #undef SCOPY #undef ICOPY bip_notify(ic, "connection added, you should soon be able to connect"); } static int add_connection(bip_t *bip, struct bipuser *user, list_t *data) { struct tuple *t, *t2; struct link *l; struct chan_info *ci; char *name = get_tuple_pvalue(data, LEX_NAME); if (name == NULL) { conf_die(bip, "Connection with no name"); return 0; } l = hash_get(&user->connections, name); if (!l) { l = irc_link_new(); hash_insert(&user->connections, name, l); list_add_last(&bip->link_list, l); l->user = user; l->log = log_new(user, name); #ifdef HAVE_LIBSSL l->ssl_check_mode = user->ssl_check_mode; l->untrusted_certs = sk_X509_new_null(); #endif } else { l->network = NULL; log_reset_all(l->log); } while ((t = list_remove_first(data))) { switch (t->type) { case LEX_NAME: MOVE_STRING(l->name, t->pdata); break; case LEX_NETWORK: l->network = hash_get(&bip->networks, t->pdata); if (!l->network) { conf_die(bip, "Undefined network %s.\n", t->pdata); return 0; } break; case LEX_NICK: if (!is_valid_nick(t->pdata)) { conf_die(bip, "Invalid nickname %s.", t->pdata); return 0; } MOVE_STRING(l->connect_nick, t->pdata); break; case LEX_USER: MOVE_STRING(l->username, t->pdata); break; case LEX_REALNAME: MOVE_STRING(l->realname, t->pdata); break; case LEX_PASSWORD: MOVE_STRING(l->s_password, t->pdata); break; case LEX_SASL_USERNAME: MOVE_STRING(l->sasl_username, t->pdata); break; case LEX_SASL_PASSWORD: MOVE_STRING(l->sasl_password, t->pdata); break; case LEX_SASL_MECHANISM: if (strcmp(t->pdata, "PLAIN") == 0) { l->sasl_mechanism = SASL_AUTH_PLAIN; } else if (strcmp(t->pdata, "EXTERNAL") == 0) { l->sasl_mechanism = SASL_AUTH_EXTERNAL; } else { conf_die(bip, "Unsupported SASL mechanism %s.", t->pdata); return 0; } break; case LEX_VHOST: MOVE_STRING(l->vhost, t->pdata); break; case LEX_CHANNEL: name = get_tuple_pvalue(t->pdata, LEX_NAME); if (name == NULL) { conf_die(bip, "Channel with no name"); return 0; } ci = hash_get(&l->chan_infos, name); if (!ci) { ci = chan_info_new(); hash_insert(&l->chan_infos, name, ci); /* FIXME: this order is not reloaded */ list_add_last(&l->chan_infos_order, ci); ci->backlog = 1; } while ((t2 = list_remove_first(t->pdata))) { switch (t2->type) { case LEX_NAME: MOVE_STRING(ci->name, t2->pdata); break; case LEX_KEY: MOVE_STRING(ci->key, t2->pdata); break; case LEX_BACKLOG: ci->backlog = t2->ndata; break; default: conf_die( bip, "Unknown keyword in channel block (%d)", t2->type); return 0; } if (t2->tuple_type == TUPLE_STR && t2->pdata) free(t2->pdata); free(t2); } list_free(t->pdata); break; case LEX_AUTOJOIN_ON_KICK: l->autojoin_on_kick = (t->ndata > 0 ? 1 : 0); break; case LEX_FOLLOW_NICK: l->follow_nick = (t->ndata > 0 ? 1 : 0); break; case LEX_IGN_FIRST_NICK: l->ignore_first_nick = (t->ndata > 0 ? 1 : 0); break; case LEX_IGNORE_CAPAB: l->ignore_server_capab = (t->ndata > 0 ? 1 : 0); break; case LEX_AWAY_NICK: MOVE_STRING(l->away_nick, t->pdata); break; case LEX_NO_CLIENT_AWAY_MSG: MOVE_STRING(l->no_client_away_msg, t->pdata); break; case LEX_ON_CONNECT_SEND: list_add_last(&l->on_connect_send, t->pdata); t->pdata = NULL; break; case LEX_LOG: l->log->log_to_file = (t->ndata > 0 ? 1 : 0); break; #ifdef HAVE_LIBSSL case LEX_SSL_CHECK_MODE: if (strcmp(t->pdata, "basic") == 0) l->ssl_check_mode = SSL_CHECK_BASIC; if (strcmp(t->pdata, "ca") == 0) l->ssl_check_mode = SSL_CHECK_CA; if (strcmp(t->pdata, "none") == 0) l->ssl_check_mode = SSL_CHECK_NONE; break; #else case LEX_SSL_CHECK_MODE: mylog(LOG_WARN, "Found SSL option whereas bip is " "not built with SSL support."); break; #endif default: conf_die(bip, "Unknown keyword in connection " "statement"); return 0; } if (t->tuple_type == TUPLE_STR && t->pdata) free(t->pdata); free(t); } /* checks that can only be here, or must */ if (!l->network) { conf_die(bip, "Missing network in connection block"); return 0; } if (!l->connect_nick) { if (!user->default_nick) { conf_die(bip, "No nick set and no default nick."); return 0; } l->connect_nick = bip_strdup(user->default_nick); } if (!l->username) { if (!user->default_username) { conf_die(bip, "No username set and no default " "username."); return 0; } l->username = bip_strdup(user->default_username); } if (!l->realname) { if (!user->default_realname) { conf_die(bip, "No realname set and no default " "realname."); return 0; } l->realname = bip_strdup(user->default_realname); } if (l->sasl_username && !l->sasl_password) { conf_die(bip, "sasl_username set without sasl_password."); return 0; } if (!l->sasl_username && l->sasl_password) { conf_die(bip, "sasl_password set without sasl_username."); return 0; } if (l->sasl_mechanism == SASL_AUTH_PLAIN && (!l->sasl_username || !l->sasl_password)) { conf_die( bip, "SASL mechanism PLAIN requires username and password."); return 0; } if (l->sasl_username && !l->sasl_mechanism) l->sasl_mechanism = SASL_AUTH_PLAIN; l->in_use = 1; return 1; } static char *get_tuple_pvalue(list_t *tuple_l, int lex) { struct tuple *t; list_iterator_t it; for (list_it_init(tuple_l, &it); (t = list_it_item(&it)); list_it_next(&it)) { if (t->type == lex) return t->pdata; } return NULL; } static int get_tuple_nvalue(list_t *tuple_l, int lex) { struct tuple *t; list_iterator_t it; for (list_it_init(tuple_l, &it); (t = list_it_item(&it)); list_it_next(&it)) { if (t->type == lex) return t->ndata; } return -1; } enum BLTimestamp lex_backlog_timestamp(char *tdata) { if (strcmp(tdata, "time") == 0) { return BLTSTime; } else if (strcmp(tdata, "datetime") == 0) { return BLTSDateTime; } else { return BLTSNone; } } struct historical_directives { int always_backlog; int backlog; int bl_msg_only; int backlog_lines; enum BLTimestamp backlog_timestamp; int blreset_on_talk; }; static int add_user(bip_t *bip, list_t *data, struct historical_directives *hds) { int r; struct tuple *t; struct bipuser *u; char *name = get_tuple_pvalue(data, LEX_NAME); list_t connection_list, *cl; list_init(&connection_list, NULL); if (name == NULL) { conf_die(bip, "User with no name"); return 0; } u = hash_get(&bip->users, name); if (!u) { u = bip_calloc(sizeof(struct bipuser), (size_t)1); hash_insert(&bip->users, name, u); hash_init(&u->connections, HASH_NOCASE); u->admin = 0; u->backlog = DEFAULT_BACKLOG; u->always_backlog = DEFAULT_ALWAYS_BACKLOG; u->bl_msg_only = DEFAULT_BL_MSG_ONLY; u->backlog_lines = DEFAULT_BACKLOG_LINES; u->backlog_timestamp = DEFAULT_BACKLOG_TIMESTAMP; u->blreset_on_talk = DEFAULT_BLRESET_ON_TALK; u->blreset_connection = DEFAULT_BLRESET_CONNECTION; u->bip_use_notice = DEFAULT_BIP_USE_NOTICE; } u->backlog = (hds->backlog > 0 ? 1 : 0); u->always_backlog = (hds->always_backlog > 0 ? 1 : 0); u->bl_msg_only = (hds->bl_msg_only > 0 ? 1 : 0); u->backlog_lines = (hds->backlog_lines > 0 ? 1 : 0); u->backlog_timestamp = (hds->backlog_timestamp > 0 ? 1 : 0); u->blreset_on_talk = (hds->blreset_on_talk > 0 ? 1 : 0); while ((t = list_remove_first(data))) { switch (t->type) { case LEX_NAME: MOVE_STRING(u->name, t->pdata); break; case LEX_ADMIN: u->admin = (t->ndata > 0 ? 1 : 0); break; case LEX_PASSWORD: hash_binary(t->pdata, &u->password, &u->seed); free(t->pdata); t->pdata = NULL; break; case LEX_DEFAULT_NICK: MOVE_STRING(u->default_nick, t->pdata); break; case LEX_DEFAULT_USER: MOVE_STRING(u->default_username, t->pdata); break; case LEX_DEFAULT_REALNAME: MOVE_STRING(u->default_realname, t->pdata); break; case LEX_ALWAYS_BACKLOG: u->always_backlog = (t->ndata > 0 ? 1 : 0); break; case LEX_BACKLOG: u->backlog = (t->ndata > 0 ? 1 : 0); break; case LEX_BL_MSG_ONLY: u->bl_msg_only = (t->ndata > 0 ? 1 : 0); break; case LEX_BACKLOG_LINES: u->backlog_lines = t->ndata; break; case LEX_BACKLOG_NO_TIMESTAMP: u->backlog_timestamp = t->ndata ? BLTSNone : BLTSTime; break; case LEX_BACKLOG_TIMESTAMP: u->backlog_timestamp = lex_backlog_timestamp(t->pdata); break; case LEX_BLRESET_ON_TALK: u->blreset_on_talk = (t->ndata > 0 ? 1 : 0); break; case LEX_BLRESET_CONNECTION: u->blreset_connection = (t->ndata > 0 ? 1 : 0); break; case LEX_BIP_USE_NOTICE: u->bip_use_notice = (t->ndata > 0 ? 1 : 0); break; case LEX_CONNECTION: list_add_last(&connection_list, t->pdata); t->pdata = NULL; break; #ifdef HAVE_LIBSSL case LEX_SSL_CHECK_MODE: if (!strcmp(t->pdata, "basic")) u->ssl_check_mode = SSL_CHECK_BASIC; if (!strcmp(t->pdata, "ca")) u->ssl_check_mode = SSL_CHECK_CA; if (!strcmp(t->pdata, "none")) u->ssl_check_mode = SSL_CHECK_NONE; free(t->pdata); t->pdata = NULL; break; case LEX_SSL_CHECK_STORE: MOVE_STRING(u->ssl_check_store, t->pdata); break; case LEX_SSL_CLIENT_CERTFILE: MOVE_STRING(u->ssl_client_certfile, t->pdata); break; #else case LEX_SSL_CLIENT_CERTFILE: case LEX_SSL_CHECK_MODE: case LEX_SSL_CHECK_STORE: mylog(LOG_WARN, "Found SSL option whereas bip is " "not built with SSL support."); break; #endif default: conf_die(bip, "Unknown keyword in user statement"); return 0; } if (t->tuple_type == TUPLE_STR && t->pdata) free(t->pdata); free(t); } if (!u->password) { conf_die(bip, "Missing password in user block"); return 0; } while ((cl = list_remove_first(&connection_list))) { r = add_connection(bip, u, cl); free(cl); if (!r) return 0; } u->in_use = 1; return 1; } static int validate_config(bip_t *bip) { /* nick username realname or default_{nick,username,realname} in user */ hash_iterator_t it, sit, cit; struct bipuser *user; struct link *link; struct chan_info *ci; int r = 1; for (hash_it_init(&bip->users, &it); (user = hash_it_item(&it)); hash_it_next(&it)) { for (hash_it_init(&user->connections, &sit); (link = hash_it_item(&sit)); hash_it_next(&sit)) { if (!user->default_nick || !user->default_username || !user->default_realname) { if ((!link->username && !user->default_username) || (!link->connect_nick && !user->default_nick) || (!link->realname && !user->default_realname)) { conf_die(bip, "user %s, " "connection %s: you must defin" "e nick, user and realname.", user->name, link->name); link_kill(bip, link); r = 0; continue; } } for (hash_it_init(&link->chan_infos, &cit); (ci = hash_it_item(&cit)); hash_it_next(&cit)) { if (!ci->name) { conf_die(bip, "user %s, " "connection " "%s: channel must have" "a name.", user->name, link->name); r = 0; continue; } } } if (user->backlog && !conf_log && user->backlog_lines == 0) { conf_die(bip, "If conf_log = false, you must set " "backlog_" "lines to a non-nul value for each user with" "backlog = true. Faulty user is %s", user->name); r = 0; continue; } } if (!strstr(conf_log_format, "%u")) { hash_it_init(&bip->users, &it); if (hash_it_item(&it)) { // hash contains at least one element hash_it_next(&it); if (hash_it_item(&it)) { // hash contains at least two elements mylog(LOG_WARN, "log_format does not contain %%u, all users'" " logs will be mixed !"); } } } return r; } void clear_marks(bip_t *bip) { list_iterator_t lit; hash_iterator_t hit; for (list_it_init(&bip->link_list, &lit); list_it_item(&lit); list_it_next(&lit)) ((struct link *)list_it_item(&lit))->in_use = 0; for (hash_it_init(&bip->users, &hit); hash_it_item(&hit); hash_it_next(&hit)) ((struct bipuser *)hash_it_item(&hit))->in_use = 0; } void user_kill(bip_t *bip, struct bipuser *user) { (void)bip; if (!hash_is_empty(&user->connections)) fatal("user_kill, user still has connections"); free(user->name); free(user->password); MAYFREE(user->default_nick); MAYFREE(user->default_username); MAYFREE(user->default_realname); #ifdef HAVE_LIBSSL MAYFREE(user->ssl_check_store); MAYFREE(user->ssl_client_certfile); #endif free(user); } void sweep(bip_t *bip) { list_iterator_t lit; hash_iterator_t hit; for (list_it_init(&bip->link_list, &lit); list_it_item(&lit); list_it_next(&lit)) { struct link *l = ((struct link *)list_it_item(&lit)); if (!l->in_use) { mylog(LOG_INFO, "Administratively killing %s/%s", l->user->name, l->name); list_remove_if_exists(&bip->conn_list, l); link_kill(bip, l); list_it_remove(&lit); } } for (hash_it_init(&bip->users, &hit); hash_it_item(&hit); hash_it_next(&hit)) { struct bipuser *u = (struct bipuser *)hash_it_item(&hit); if (!u->in_use) { hash_it_remove(&hit); user_kill(bip, u); } } } int fireup(bip_t *bip, FILE *conf) { int r; struct tuple *t; int err = 0; struct historical_directives hds; char *l; clear_marks(bip); while ((l = list_remove_first(&bip->errors))) free(l); parse_conf(conf, &err); if (err) { free_conf(root_list); root_list = NULL; return 0; } #define SET_HV(d, n) \ do { \ int __gtv = get_tuple_nvalue(root_list, LEX_##n); \ if (__gtv != -1) \ d = __gtv; \ else \ d = DEFAULT_##n; \ } while (0); SET_HV(hds.always_backlog, ALWAYS_BACKLOG); SET_HV(hds.backlog, BACKLOG); SET_HV(hds.bl_msg_only, BL_MSG_ONLY); SET_HV(hds.backlog_lines, BACKLOG_LINES); SET_HV(hds.backlog_timestamp, BACKLOG_TIMESTAMP); SET_HV(hds.blreset_on_talk, BLRESET_ON_TALK); #undef SET_HV while ((t = list_remove_first(root_list))) { switch (t->type) { case LEX_LOG_SYNC_INTERVAL: conf_log_sync_interval = t->ndata; break; case LEX_LOG: conf_log = t->ndata; break; case LEX_LOG_SYSTEM: conf_log_system = t->ndata; break; case LEX_LOG_ROOT: MOVE_STRING(conf_log_root, t->pdata); break; case LEX_LOG_FORMAT: MOVE_STRING(conf_log_format, t->pdata); break; case LEX_LOG_LEVEL: conf_log_level = t->ndata; break; case LEX_IP: MOVE_STRING(conf_ip, t->pdata); break; case LEX_PORT: conf_port = (unsigned short)t->ndata; break; case LEX_RECONN_TIMER: conf_reconn_timer = t->ndata; break; #ifdef HAVE_LIBSSL case LEX_DEFAULT_CIPHERS: MOVE_STRING(conf_server_default_ciphers, t->pdata); break; case LEX_CSS_CIPHERS: MOVE_STRING(conf_client_ciphers, t->pdata); break; case LEX_CSS: conf_css = t->ndata; break; case LEX_CSS_PEM: MOVE_STRING(conf_ssl_certfile, t->pdata); break; case LEX_DH_PARAM: MOVE_STRING(conf_client_dh_file, t->pdata); break; #else case LEX_DEFAULT_CIPHERS: case LEX_CSS: case LEX_CSS_CIPHERS: case LEX_CSS_PEM: case LEX_DH_PARAM: mylog(LOG_WARN, "Found SSL option whereas bip is " "not built with SSL support."); break; #endif case LEX_PID_FILE: MOVE_STRING(conf_pid_file, t->pdata); break; case LEX_WRITE_OIDENTD: bip->write_oidentd = t->ndata; break; case LEX_OIDENTD_FILE: MOVE_STRING(bip->oidentdpath, t->pdata); break; case LEX_ALWAYS_BACKLOG: hds.always_backlog = t->ndata; break; case LEX_BACKLOG: hds.backlog = t->ndata; break; case LEX_BL_MSG_ONLY: hds.bl_msg_only = t->ndata; break; case LEX_BACKLOG_LINES: hds.backlog_lines = t->ndata; break; case LEX_BACKLOG_NO_TIMESTAMP: hds.backlog_timestamp = t->ndata ? BLTSNone : BLTSTime; break; case LEX_BACKLOG_TIMESTAMP: hds.backlog_timestamp = lex_backlog_timestamp(t->pdata); break; case LEX_BLRESET_ON_TALK: hds.blreset_on_talk = t->ndata; break; case LEX_NETWORK: r = add_network(bip, t->pdata); list_free(t->pdata); if (!r) goto out_conf_error; break; case LEX_USER: r = add_user(bip, t->pdata, &hds); list_free(t->pdata); if (!r) goto out_conf_error; break; default: conf_die(bip, "Config error in base config (%d)", t->type); goto out_conf_error; } if (t->tuple_type == TUPLE_STR && t->pdata) free(t->pdata); free(t); } free(root_list); root_list = NULL; if (validate_config(bip)) { sweep(bip); return 1; } else { return 0; } out_conf_error: free_conf(root_list); root_list = NULL; return 0; } void check_rlimits(void) { int r, cklim; struct rlimit lt; cklim = 0; #ifdef RLIMIT_AS r = getrlimit(RLIMIT_AS, <); if (r) { mylog(LOG_ERROR, "getrlimit(): failed with %s", strerror(errno)); } else { if (lt.rlim_max != RLIM_INFINITY) { mylog(LOG_WARN, "virtual memory rlimit active, " "bip may be KILLED by the system"); cklim = 1; } } #endif r = getrlimit(RLIMIT_CPU, <); if (r) { mylog(LOG_ERROR, "getrlimit(): failed with %s", strerror(errno)); } else { if (lt.rlim_max != RLIM_INFINITY) { mylog(LOG_WARN, "CPU rlimit active, bip may " "be OFTEN KILLED by the system"); cklim = 1; } } r = getrlimit(RLIMIT_FSIZE, <); if (r) { mylog(LOG_ERROR, "getrlimit(): failed with %s", strerror(errno)); } else { if (lt.rlim_max != RLIM_INFINITY) { mylog(LOG_WARN, "FSIZE rlimit active, bip will " "fail to create files of size greater than " "%d bytes.", (int)lt.rlim_max); cklim = 1; } } r = getrlimit(RLIMIT_NOFILE, <); if (r) { mylog(LOG_ERROR, "getrlimit(): failed with %s", strerror(errno)); } else { if (lt.rlim_max != RLIM_INFINITY && lt.rlim_max < 256) { mylog(LOG_WARN, "opened files count rlimit " "active, bip will not be allowed to open more " "than %d files at a time", (int)lt.rlim_max); cklim = 1; } } r = getrlimit(RLIMIT_STACK, <); if (r) { mylog(LOG_ERROR, "getrlimit(): failed with %s", strerror(errno)); } else { if (lt.rlim_max != RLIM_INFINITY) { mylog(LOG_WARN, "stack rlimit active, " "bip may be KILLED by the system"); cklim = 1; } } if (cklim) mylog(LOG_WARN, "You can check your limits with `ulimit -a'"); } #define RET_STR_LEN 256 #define LINE_SIZE_LIM 70 void adm_print_connection(struct link_client *ic, struct link *lnk, struct bipuser *bu) { hash_iterator_t lit; char buf[LINE_SIZE_LIM + 1]; char *bufpos = buf; size_t remaining = LINE_SIZE_LIM; if (!bu) bu = lnk->user; bip_notify(ic, "* %s to %s as \"%s\" (%s!%s) :", lnk->name, lnk->network->name, (lnk->realname ? lnk->realname : bu->default_realname), (lnk->connect_nick ? lnk->connect_nick : bu->default_nick), (lnk->username ? lnk->username : bu->default_username)); bufpos = bip_strcat_fit(&remaining, bufpos, " Options:"); // This should not happen, unless LINE_SIZE_LIM is too low if (!bufpos) goto limittoolow; if (lnk->follow_nick) { bufpos = bip_strcat_fit(&remaining, bufpos, " follow_nick"); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcat_fit(&remaining, bufpos, " follow_nick"); if (!bufpos) goto limittoolow; } } if (lnk->ignore_first_nick) { bufpos = bip_strcat_fit(&remaining, bufpos, " ignore_first_nick"); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcat_fit(&remaining, bufpos, " ignore_first_nick"); if (!bufpos) goto limittoolow; } } if (lnk->away_nick) { bufpos = bip_strcatf_fit(&remaining, bufpos, " away_nick=%s", lnk->away_nick); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcatf_fit(&remaining, bufpos, " away_nick=%s", lnk->away_nick); if (!bufpos) goto limittoolow; } } if (lnk->no_client_away_msg) { bufpos = bip_strcatf_fit(&remaining, bufpos, " no_client_away_msg=%s", lnk->no_client_away_msg); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcatf_fit(&remaining, bufpos, " no_client_away_msg=%s", lnk->no_client_away_msg); if (!bufpos) goto limittoolow; } } if (lnk->vhost) { bufpos = bip_strcatf_fit(&remaining, bufpos, " vhost=%s", lnk->vhost); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcatf_fit(&remaining, bufpos, " vhost=%s", lnk->vhost); if (!bufpos) goto limittoolow; } } if (lnk->bind_port) { bufpos = bip_strcatf_fit(&remaining, bufpos, " bind_port=%s", lnk->bind_port); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcatf_fit(&remaining, bufpos, " bind_port=%s", lnk->bind_port); if (!bufpos) goto limittoolow; } } buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; list_iterator_t itocs; for (list_it_init(&lnk->on_connect_send, &itocs); list_it_item(&itocs);) { bufpos = bip_strcatf_fit(&remaining, bufpos, "%s", (char *)list_it_item(&itocs)); if (!bufpos) { // if oversized, print and reset buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; continue; } else { // if ok, go to next item list_it_next(&itocs); } } buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; // TODO : check channels struct bufpos = bip_strcat_fit(&remaining, bufpos, " Channels (* with key, ` no backlog)"); if (!bufpos) goto limittoolow; for (hash_it_init(&lnk->chan_infos, &lit); hash_it_item(&lit); hash_it_next(&lit)) { struct chan_info *ch = hash_it_item(&lit); bufpos = bip_strcatf_fit(&remaining, bufpos, "%s%s%s", ch->name, (ch->key ? "*" : ""), (ch->backlog ? "" : "`")); if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; } } buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; bufpos = bip_strcat_fit(&remaining, bufpos, " Status: "); if (!bufpos) goto limittoolow; switch (lnk->s_state) { case IRCS_NONE: bufpos = bip_strcat_fit(&remaining, bufpos, "not started"); if (!bufpos) goto limittoolow; break; case IRCS_CONNECTING: bufpos = bip_strcatf_fit(&remaining, bufpos, "connecting... attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (!bufpos) goto noroomstatus; break; case IRCS_CONNECTED: bufpos = bip_strcat_fit(&remaining, bufpos, "connected !"); if (!bufpos) goto limittoolow; break; case IRCS_WAS_CONNECTED: bufpos = bip_strcatf_fit(&remaining, bufpos, "disconnected, attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (!bufpos) goto noroomstatus; break; case IRCS_RECONNECTING: bufpos = bip_strcatf_fit( &remaining, bufpos, "reconnecting... attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (!bufpos) goto noroomstatus; break; case IRCS_TIMER_WAIT: bufpos = bip_strcatf_fit( &remaining, bufpos, "waiting to reconnect, attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (!bufpos) goto noroomstatus; break; default: bufpos = bip_strcat_fit(&remaining, bufpos, "unknown"); if (!bufpos) goto limittoolow; break; // s_conn_attempt recon_timer last_connection_attempt } buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); return; noroomstatus: buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%stoo long to print", buf); return; limittoolow: bip_notify(ic, "cannot print connection, LINE_SIZE_LIM(%d) " "is too low (please recompile)", LINE_SIZE_LIM); return; } void adm_list_all_links(struct link_client *ic) { list_iterator_t it; bip_notify(ic, "-- All links"); for (list_it_init(&_bip->link_list, &it); list_it_item(&it); list_it_next(&it)) { struct link *l = list_it_item(&it); if (l) adm_print_connection(ic, l, NULL); } bip_notify(ic, "-- End of All links"); } void adm_list_all_connections(struct link_client *ic) { hash_iterator_t it; bip_notify(ic, "-- All connections"); for (hash_it_init(&_bip->users, &it); hash_it_item(&it); hash_it_next(&it)) { struct bipuser *u = hash_it_item(&it); if (u) adm_list_connections(ic, u); } bip_notify(ic, "-- End of All connections"); } #define STRORNULL(s) ((s) == NULL ? "unset" : (s)) void adm_info_user(struct link_client *ic, const char *name) { struct bipuser *u; bip_notify(ic, "-- User '%s' info", name); u = hash_get(&_bip->users, name); if (!u) { bip_notify(ic, "Unknown user"); return; } bip_notify(ic, "user: %s%s", u->name, (u->admin ? ", is bip admin" : "")); #ifdef HAVE_LIBSSL if (u->ssl_check_store) { bip_notify(ic, "SSL check mode '%s', stored into '%s'", checkmode2text(u->ssl_check_mode), u->ssl_check_store); } else { bip_notify( ic, "SSL check mode '%s', default or no certificate store", checkmode2text(u->ssl_check_mode)); } if (u->ssl_client_certfile) bip_notify(ic, "SSL client certificate stored into '%s'", u->ssl_client_certfile); #endif bip_notify(ic, "Defaults nick: %s, user: %s, realname: %s", STRORNULL(u->default_nick), STRORNULL(u->default_username), STRORNULL(u->default_realname)); if (u->backlog) { bip_notify(ic, "Backlog enabled, lines: %d, timestamp: %s," " messages only: %s", u->backlog_lines, u->backlog_timestamp == BLTSNone ? "none" : (u->backlog_timestamp == BLTSTime ? "time" : "datetime"), bool2text(u->bl_msg_only)); bip_notify(ic, "always backlog: %s, reset on talk: %s", bool2text(u->always_backlog), bool2text(u->blreset_on_talk)); } else { bip_notify(ic, "Backlog disabled"); } adm_list_connections(ic, u); bip_notify(ic, "-- End of User '%s' info", name); } void adm_list_users(struct link_client *ic) { hash_iterator_t it; hash_iterator_t lit; char buf[LINE_SIZE_LIM + 1]; size_t remaining = LINE_SIZE_LIM; bip_notify(ic, "-- User list"); for (hash_it_init(&_bip->users, &it); hash_it_item(&it); hash_it_next(&it)) { struct bipuser *u = hash_it_item(&it); int first = 1; char *bufpos = buf; bufpos = bip_strcatf_fit(&remaining, bufpos, "* %s%s:", u->name, (u->admin ? "(admin)" : "")); // this should not happen or LINE_SIZE_LIM is really low... if (!bufpos) goto limittoolow; for (hash_it_init(&u->connections, &lit); hash_it_item(&lit);) { struct link *lnk = hash_it_item(&lit); if (first) { first = 0; } else { bufpos = bip_strcat_fit(&remaining, bufpos, ","); // if this is too long for a comma, print and // prefix with spaces if (!bufpos) { buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcat_fit(&remaining, buf, " "); ; // this should not happen or // LINE_SIZE_LIM is really low... if (!bufpos) goto limittoolow; } } bufpos = bip_strcatf_fit(&remaining, bufpos, " %s", lnk->name); if (!bufpos) { // if this is too long, print and reset buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = bip_strcat_fit(&remaining, buf, " "); ; // this should not happen or LINE_SIZE_LIM is // really low... if (!bufpos) goto limittoolow; } else { // if all good, go to next entry hash_it_next(&lit); } } buf[LINE_SIZE_LIM] = 0; bip_notify(ic, "%s", buf); remaining = LINE_SIZE_LIM; bufpos = buf; } bip_notify(ic, "-- End of User list"); return; limittoolow: bip_notify(ic, "cannot print users, LINE_SIZE_LIM(%d) " "is too low (please recompile)", LINE_SIZE_LIM); } void adm_list_networks(struct link_client *ic) { hash_iterator_t it; char buf[RET_STR_LEN + 1]; bip_notify(ic, "-- Network list (* means SSL):"); for (hash_it_init(&_bip->networks, &it); hash_it_item(&it); hash_it_next(&it)) { struct network *n = hash_it_item(&it); int i; char *bufpos = buf; size_t remaining = RET_STR_LEN; #ifdef HAVE_LIBSSL if (n->ssl) { bufpos = bip_strcatf_fit(&remaining, bufpos, "- %s*:", n->name); } else { #endif bufpos = bip_strcatf_fit(&remaining, bufpos, "- %s:", n->name); #ifdef HAVE_LIBSSL } #endif // if we've reached max length, print name and reset // honestly, this should not happen, but for the sake of // cleanliness... if (!bufpos) { #ifdef HAVE_LIBSSL if (n->ssl) { bip_notify(ic, "- %s*:", n->name); } else { #endif bip_notify(ic, "- %s:", n->name); #ifdef HAVE_LIBSSL } #endif bufpos = buf; remaining = RET_STR_LEN; } for (i = 0; i < n->serverc;) { struct server *serv = i + n->serverv; bufpos = bip_strcatf_fit(&remaining, bufpos, " %s:%d", serv->host, serv->port); if (!bufpos) { // if line is too long, print and reset buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); remaining = RET_STR_LEN; bufpos = buf; i--; } else { // if ok, go to next server i++; } } buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); } bip_notify(ic, "-- End of Network list"); } void adm_list_connections(struct link_client *ic, struct bipuser *bu) { hash_iterator_t it; if (!bu) { bip_notify(ic, "-- Your connections:"); bu = LINK(ic)->user; } else { bip_notify(ic, "-- User %s's connections:", bu->name); } for (hash_it_init(&bu->connections, &it); hash_it_item(&it); hash_it_next(&it)) { struct link *lnk = hash_it_item(&it); adm_print_connection(ic, lnk, bu); } bip_notify(ic, "-- End of Connection list"); } #ifdef HAVE_LIBSSL int link_add_untrusted(struct link_server *ls, X509 *cert) { int i; /* Check whether the cert is already in the stack */ for (i = 0; i < sk_X509_num(LINK(ls)->untrusted_certs); i++) { if (!X509_cmp(cert, sk_X509_value(LINK(ls)->untrusted_certs, i))) return 1; } return sk_X509_push(LINK(ls)->untrusted_certs, cert); } int ssl_check_trust(struct link_client *ic) { X509 *trustcert = NULL; char subject[270]; char issuer[270]; unsigned char fp[EVP_MAX_MD_SIZE]; char fpstr[EVP_MAX_MD_SIZE * 3 + 20]; unsigned int fplen; int i; if (!LINK(ic)->untrusted_certs || sk_X509_num(LINK(ic)->untrusted_certs) <= 0) { ic->allow_trust = 0; return 0; } trustcert = sk_X509_value(LINK(ic)->untrusted_certs, 0); strcpy(subject, "Subject: "); strcpy(issuer, "Issuer: "); strcpy(fpstr, "MD5 fingerprint: "); X509_NAME_oneline(X509_get_subject_name(trustcert), subject + 9, 256); X509_NAME_oneline(X509_get_issuer_name(trustcert), issuer + 9, 256); X509_digest(trustcert, EVP_md5(), fp, &fplen); for (i = 0; i < (int)fplen; i++) sprintf(fpstr + 17 + (i * 3), "%02X%c", fp[i], (i == (int)fplen - 1) ? '\0' : ':'); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", "This server SSL certificate was not " "accepted because it is not in your store " "of trusted certificates:"); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", subject); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", issuer); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", fpstr); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", "WARNING: if you've already trusted a " "certificate for this server before, that " "probably means it has changed."); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", "If so, YOU MAY BE SUBJECT OF A " "MAN-IN-THE-MIDDLE ATTACK! PLEASE DON'T TRUST " "THIS CERTIFICATE IF YOU'RE NOT SURE THIS IS " "NOT THE CASE."); WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", "Type /QUOTE BIP TRUST OK to trust this " "certificate, /QUOTE BIP TRUST NO to discard it."); TYPE(ic) = IRC_TYPE_TRUST_CLIENT; ic->allow_trust = 1; return 1; } #if 0 static int ssl_trust_next_cert(struct link_client *ic) { (void)ic; } static int ssl_discard_next_cert(struct link_client *ic) { (void)ic; } #endif /* 0 */ #endif #ifdef HAVE_LIBSSL int adm_trust(struct link_client *ic, struct line *line) { if (ic->allow_trust != 1) { /* shouldn't have been asked to /QUOTE BIP TRUST but well... */ WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", "TrustEm", "No untrusted certificates."); return OK_FORGET; } if (irc_line_count(line) != 3) return ERR_PROTOCOL; if (irc_line_elem_case_equals(line, 2, "OK")) { /* OK, attempt to trust the cert! */ BIO *bio = BIO_new_file(LINK(ic)->user->ssl_check_store, "a+"); X509 *trustcert = sk_X509_shift(LINK(ic)->untrusted_certs); if (!bio || !trustcert || PEM_write_bio_X509(bio, trustcert) <= 0) write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":==== Error while trusting test!\r\n"); else write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":==== Certificate now trusted.\r\n"); BIO_free_all(bio); X509_free(trustcert); } else if (irc_line_elem_case_equals(line, 2, "NO")) { /* NO, discard the cert! */ write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":==== Certificate discarded.\r\n"); X509_free(sk_X509_shift(LINK(ic)->untrusted_certs)); } else return ERR_PROTOCOL; if (!ssl_check_trust(ic)) { write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":No more certificates waiting awaiting " "user trust, thanks!\r\n"); write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":If the certificate is trusted, bip should " "be able to connect to the server on the " "next retry. Please wait a while and try " "connecting your client again.\r\n"); LINK(ic)->recon_timer = 1; /* Speed up reconnection... */ return OK_CLOSE; } return OK_FORGET; } #endif void _bip_notify(struct link_client *ic, char *fmt, va_list ap) { char *nick; char str[4096]; if (LINK(ic)->l_server) nick = LINK(ic)->l_server->nick; else nick = LINK(ic)->prev_nick; vsnprintf(str, (size_t)4095, fmt, ap); str[4095] = 0; WRITE_LINE2(CONN(ic), P_IRCMASK, (LINK(ic)->user->bip_use_notice ? "NOTICE" : "PRIVMSG"), nick, str); } void bip_notify(struct link_client *ic, char *fmt, ...) { va_list ap; va_start(ap, fmt); _bip_notify(ic, fmt, ap); va_end(ap); } void adm_blreset(struct link_client *ic) { log_reset_all(LINK(ic)->log); bip_notify(ic, "backlog reset for this network."); } void adm_blreset_store(struct link_client *ic, const char *store) { log_reset_store(LINK(ic)->log, store); bip_notify(ic, "backlog reset for %s.", store); } void adm_follow_nick(struct link_client *ic, const char *val) { struct link *link = LINK(ic); if (strcasecmp(val, "TRUE") == 0) { link->follow_nick = 1; bip_notify(ic, "follow_nick is now true."); } else { link->follow_nick = 0; bip_notify(ic, "follow_nick is now false."); } } void adm_ignore_first_nick(struct link_client *ic, const char *val) { struct link *link = LINK(ic); if (strcasecmp(val, "TRUE") == 0) { link->ignore_first_nick = 1; bip_notify(ic, "ignore_first_nick is now true."); } else { link->ignore_first_nick = 0; bip_notify(ic, "ignore_first_nick is now false."); } } void set_on_connect_send(struct link_client *ic, char *val) { struct link *link = LINK(ic); char *s; if (val != NULL) { list_add_last(&link->on_connect_send, bip_strdup(val)); bip_notify(ic, "added to on_connect_send."); } else { s = list_remove_last(&link->on_connect_send); if (s) free(s); bip_notify(ic, "last on_connect_send string deleted."); } } #define ON_CONNECT_MAX_STRSIZE 1024 void adm_on_connect_send(struct link_client *ic, struct line *line, int privmsg) { size_t remaining = ON_CONNECT_MAX_STRSIZE; char buf[ON_CONNECT_MAX_STRSIZE]; char *bufpos = buf; int i; if (!line) { set_on_connect_send(ic, NULL); return; } if (!irc_line_includes(line, 2)) { mylog(LOG_DEBUG, "[%s] not enough parameters on /BIP on_connect_send", LINK(ic)->user->name); return; } for (i = privmsg + 2; i < irc_line_count(line); i++) { mylog(LOG_DEBUG, "[%s] processing item %d, remaining %ld, %s", LINK(ic)->user->name, i, remaining, buf); if (i > privmsg + 2) bufpos = bip_strcatf_fit(&remaining, bufpos, " %s", irc_line_elem(line, i)); else bufpos = bip_strcat_fit(&remaining, bufpos, irc_line_elem(line, i)); mylog(LOG_DEBUG, "[%s] processed item %d, remaining %ld, %s", LINK(ic)->user->name, i, remaining, buf); if (!bufpos) { bip_notify( ic, "on connect send string too big, not changing."); return; } } buf[ON_CONNECT_MAX_STRSIZE - 1] = 0; set_on_connect_send(ic, buf); return; } void adm_away_nick(struct link_client *ic, const char *val) { struct link *link = LINK(ic); if (link->away_nick) { free(link->away_nick); link->away_nick = NULL; } if (val != NULL) { link->away_nick = bip_strdup(val); bip_notify(ic, "away_nick set."); } else { bip_notify(ic, "away_nick cleared."); } } void adm_bip_help(struct link_client *ic, int admin, const char *subhelp) { if (subhelp == NULL) { if (admin) { bip_notify(ic, "/BIP RELOAD # Re-read bip " "configuration and apply changes."); bip_notify(ic, "/BIP INFO user " "# show a user's configuration"); bip_notify(ic, "/BIP LIST networks|users|connections|" "all_links|all_connections"); bip_notify(ic, "/BIP ADD_CONN " ""); bip_notify(ic, "/BIP DEL_CONN "); } else { bip_notify(ic, "/BIP LIST networks|connections"); } bip_notify(ic, "/BIP JUMP # jump to next server (in same " "network)"); bip_notify(ic, "/BIP BLRESET [channel|query]# reset backlog " "(this connection only). Add -q flag and the " "operation is quiet. You can specify a channel " "or a nick to reset only this channel/query."); bip_notify(ic, "/BIP HELP [subhelp] # show this help..."); bip_notify(ic, "## Temporary changes for this connection:"); bip_notify(ic, "/BIP FOLLOW_NICK|IGNORE_FIRST_NICK TRUE|FALSE"); bip_notify(ic, "/BIP ON_CONNECT_SEND # Adds a string to " "send on connect"); bip_notify(ic, "/BIP ON_CONNECT_SEND # Clears on_connect_send"); bip_notify(ic, "/BIP AWAY_NICK # Set away nick"); bip_notify(ic, "/BIP AWAY_NICK # clear away nick"); bip_notify(ic, "/BIP BACKLOG [n] # backlog text of the n last " "hours"); } else if (admin && strcasecmp(subhelp, "RELOAD") == 0) { bip_notify(ic, "/BIP RELOAD (admin only) :"); bip_notify(ic, " Reloads bip configuration file and apply " "changes."); bip_notify(ic, " Please note that changes to 'user' or " "'realname' will not be applied without a JUMP."); } else if (admin && strcasecmp(subhelp, "INFO") == 0) { bip_notify(ic, "/BIP INFO USER (admin only) :"); bip_notify(ic, " Show 's current configuration."); bip_notify(ic, " That means it may be different from the " "configuration stored in bip.conf"); } else if (admin && strcasecmp(subhelp, "ADD_CONN") == 0) { bip_notify(ic, "/BIP ADD_CONN " "(admin only) :"); bip_notify(ic, " Add a connection named to " "the network to your connection list"); bip_notify(ic, " should already exist in bip's " "configuration."); } else if (admin && strcasecmp(subhelp, "DEL_CONN") == 0) { bip_notify(ic, "/BIP DEL_CONN (admin only) " ":"); bip_notify(ic, " Remove the connection named from your connection list."); bip_notify(ic, " Removing a connection will cause " "its disconnection."); } else if (strcasecmp(subhelp, "JUMP") == 0) { bip_notify(ic, "/BIP JUMP :"); bip_notify(ic, " Jump to next server in current network."); } else if (strcasecmp(subhelp, "BLRESET") == 0) { bip_notify(ic, "/BIP BLRESET :"); bip_notify(ic, " Reset backlog on this network."); } else if (strcasecmp(subhelp, "FOLLOW_NICK") == 0) { bip_notify(ic, "/BIP FOLLOW_NICK TRUE|FALSE :"); bip_notify(ic, " Change the value of the follow_nick option " "for this connection."); bip_notify(ic, " If set to true, when you change nick, " "BIP stores the new nickname as the new default " "nickname value."); bip_notify(ic, " Thus, if you are disconnected from the " "server, BIP will restore the correct nickname."); } else if (strcasecmp(subhelp, "IGNORE_FIRST_NICK") == 0) { bip_notify(ic, "/BIP IGNORE_FIRST_NICK TRUE|FALSE :"); bip_notify(ic, " Change the value of the ignore_first_nick " "option for this connection."); bip_notify(ic, " If set to TRUE, BIP will ignore the nickname" "sent by the client upon connect."); bip_notify(ic, " Further nickname changes will be processed " "as usual."); } else if (strcasecmp(subhelp, "ON_CONNECT_SEND") == 0) { bip_notify(ic, "/BIP ON_CONNECT_SEND [some text] :"); bip_notify(ic, " BIP will send the text as is to the server " "upon connection."); bip_notify(ic, " You can call this command more than once."); bip_notify( ic, " If [some text] is empty, this command will " "remove any on_connect_send defined for this connection."); } else if (strcasecmp(subhelp, "AWAY_NICK") == 0) { bip_notify(ic, "/BIP AWAY_NICK [some_nick] :"); bip_notify( ic, " If [some_nick] is set, BIP will change " "nickname to [some_nick] if there are no more client " "attached"); bip_notify(ic, " If [some_nick] is empty, this command will " "unset current connection's away_nick."); } else if (strcasecmp(subhelp, "LIST") == 0) { bip_notify(ic, "/BIP LIST
:"); bip_notify(ic, " List information from a these sections :"); bip_notify(ic, " - networks: list all available networks"); bip_notify(ic, " - connections: list all your configured " "connections and their state."); if (admin) { bip_notify(ic, " - users: list all users (admin)"); bip_notify(ic, " - all_links: list all connected " "sockets from and to BIP (admin)"); bip_notify(ic, " - all_connections: list all users' " "configured connections (admin)"); } } else { bip_notify(ic, "-- No sub-help for '%s'", subhelp); } } int adm_bip(bip_t *bip, struct link_client *ic, struct line *line, int privmsg) { int admin = LINK(ic)->user->admin; if (privmsg) { char *linestr, *elemstr; char *ptr, *eptr; size_t slen; if (irc_line_count(line) != 3) return OK_FORGET; linestr = irc_line_pop(line); ptr = linestr; /* all elem size <= linestr size */ elemstr = bip_malloc(strlen(linestr) + 1); while ((eptr = strstr(ptr, " "))) { // eptr is either >= ptr or NULL from strstr() // but it can't be NULL per while loop // we can then assume slen is unsigned slen = (size_t)(eptr - ptr); if (slen == 0) { ptr++; continue; } memcpy(elemstr, ptr, slen); elemstr[slen] = 0; irc_line_append(line, elemstr); ptr = eptr + 1; } slen = strlen(ptr); eptr = ptr + slen; if (slen != 0) { memcpy(elemstr, ptr, slen); elemstr[slen] = 0; irc_line_append(line, elemstr); } free(elemstr); free(linestr); } if (!irc_line_includes(line, privmsg + 1)) return OK_FORGET; mylog(LOG_INFO, "/BIP %s from %s", irc_line_elem(line, privmsg + 1), LINK(ic)->user->name); if (irc_line_elem_case_equals(line, privmsg + 1, "RELOAD")) { if (!admin) { bip_notify(ic, "-- You're not allowed to reload bip"); return OK_FORGET; } bip_notify(ic, "-- Reloading bip..."); bip->reloading_client = ic; sighup = 1; } else if (irc_line_elem_case_equals(line, privmsg + 1, "LIST")) { if (irc_line_count(line) != privmsg + 3) { bip_notify(ic, "-- LIST command needs one argument"); return OK_FORGET; } if (admin && strcasecmp(irc_line_elem(line, privmsg + 2), "users") == 0) { adm_list_users(ic); } else if (strcasecmp(irc_line_elem(line, privmsg + 2), "networks") == 0) { adm_list_networks(ic); } else if (strcasecmp(irc_line_elem(line, privmsg + 2), "connections") == 0) { adm_list_connections(ic, NULL); } else if (admin && strcasecmp(irc_line_elem(line, privmsg + 2), "all_connections") == 0) { adm_list_all_connections(ic); } else if (admin && strcasecmp(irc_line_elem(line, privmsg + 2), "all_links") == 0) { adm_list_all_links(ic); } else { bip_notify(ic, "-- Invalid LIST request"); } } else if (irc_line_elem_case_equals(line, privmsg + 1, "INFO")) { if (!irc_line_includes(line, privmsg + 3)) { bip_notify(ic, "-- INFO command needs at least two " "arguments"); return OK_FORGET; } if (admin && irc_line_elem_case_equals(line, privmsg + 2, "user")) { if (irc_line_count(line) == (privmsg + 4)) { adm_info_user(ic, irc_line_elem(line, privmsg + 3)); } else { bip_notify(ic, "-- INFO USER command needs one" " argument"); } #if 0 TODO network info #endif } else { bip_notify(ic, "-- Invalid INFO request"); } } else if (irc_line_elem_case_equals(line, privmsg + 1, "JUMP")) { if (LINK(ic)->l_server) { WRITE_LINE1(CONN(LINK(ic)->l_server), NULL, "QUIT", "jumpin' jumpin'"); connection_close(CONN(LINK(ic)->l_server)); } bip_notify(ic, "-- Jumping to next server"); } else if (irc_line_elem_case_equals(line, privmsg + 1, "BLRESET")) { if (irc_line_includes(line, privmsg + 2)) { if (irc_line_elem_equals(line, privmsg + 2, "-q")) { if (irc_line_includes(line, privmsg + 3)) { log_reset_store( LINK(ic)->log, irc_line_elem(line, privmsg + 3)); } else { log_reset_all(LINK(ic)->log); } } else { adm_blreset_store( ic, irc_line_elem(line, privmsg + 2)); } } else { adm_blreset(ic); } } else if (irc_line_elem_case_equals(line, privmsg + 1, "HELP")) { if (irc_line_count(line) == privmsg + 2) adm_bip_help(ic, admin, NULL); else if (irc_line_count(line) == privmsg + 3) adm_bip_help(ic, admin, irc_line_elem(line, privmsg + 2)); else bip_notify( ic, "-- HELP command needs at most one argument"); } else if (irc_line_elem_case_equals(line, privmsg + 1, "FOLLOW_NICK")) { if (irc_line_count(line) != privmsg + 3) { bip_notify(ic, "-- FOLLOW_NICK command needs one argument"); return OK_FORGET; } adm_follow_nick(ic, irc_line_elem(line, privmsg + 2)); } else if (irc_line_elem_case_equals(line, privmsg + 1, "IGNORE_FIRST_NICK")) { if (irc_line_count(line) != privmsg + 3) { bip_notify(ic, "-- IGNORE_FIRST_NICK " "command needs one argument"); return OK_FORGET; } adm_ignore_first_nick(ic, irc_line_elem(line, privmsg + 2)); } else if (irc_line_elem_case_equals(line, privmsg + 1, "ON_CONNECT_SEND")) { if (irc_line_count(line) == privmsg + 2) { adm_on_connect_send(ic, NULL, 0); } else if (irc_line_includes(line, privmsg + 2)) { adm_on_connect_send(ic, line, privmsg); } else { bip_notify(ic, "-- ON_CONNECT_SEND command needs at " "least one argument"); } } else if (irc_line_elem_case_equals(line, privmsg + 1, "AWAY_NICK")) { if (irc_line_count(line) == privmsg + 2) { adm_away_nick(ic, NULL); } else if (irc_line_count(line) == privmsg + 3) { adm_away_nick(ic, irc_line_elem(line, privmsg + 2)); } else { bip_notify(ic, "-- AWAY_NICK command needs zero or one" " argument"); } } else if (irc_line_elem_case_equals(line, privmsg + 1, "BACKLOG")) { if (irc_line_count(line) == privmsg + 2) { irc_cli_backlog(ic, 0); } else if (irc_line_count(line) == privmsg + 3) { int hours = atoi(irc_line_elem(line, privmsg + 2)); irc_cli_backlog(ic, hours); } else { bip_notify(ic, "-- BACKLOG takes 0 or one argument"); } } else if (admin && irc_line_elem_case_equals(line, privmsg + 1, "ADD_CONN")) { if (irc_line_count(line) != privmsg + 4) { bip_notify(ic, "/BIP ADD_CONN " ""); } else { adm_bip_addconn(bip, ic, irc_line_elem(line, privmsg + 2), irc_line_elem(line, privmsg + 3)); } } else if (admin && irc_line_elem_case_equals(line, privmsg + 1, "DEL_CONN")) { if (irc_line_count(line) != privmsg + 3) { bip_notify(ic, "/BIP DEL_CONN "); } else { adm_bip_delconn(bip, ic, irc_line_elem(line, privmsg + 2)); } #ifdef HAVE_LIBSSL } else if (strcasecmp(irc_line_elem(line, privmsg + 1), "TRUST") == 0) { return adm_trust(ic, line); #endif } else { bip_notify(ic, "Unknown command."); } return OK_FORGET; } void free_conf(list_t *l) { struct tuple *t; list_iterator_t li; for (list_it_init(l, &li); (t = list_it_item(&li)); list_it_next(&li)) { switch (t->tuple_type) { case TUPLE_STR: free(t->pdata); break; case TUPLE_INT: break; case TUPLE_LIST: free_conf(t->pdata); break; default: fatal("internal error free_conf"); break; } free(t); } free(l); } bip-0.9.3/src/lex.l0000664000175000017500000001053514212375325010764 00000000000000%option nounput noinput %{ /* * $Id: lex.l,v 1.23 2005/04/12 19:34:35 nohar Exp $ * * This file is part of the bip proproject * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "conf.h" int linec; #include "util.h" extern list_t *root_list; extern int yyparse(void); void free_conf(list_t*); int conf_error; typedef struct bip bip_t; extern bip_t *_bip; void conf_die(bip_t *, char *, ...); int yyerror(char *err) { conf_die(_bip, "Parse error '%s' near '%s', line %d", err, yytext, linec + 1); conf_error = 1; return 1; } list_t *parse_conf(FILE *file, int *err) { conf_error = 0; linec = 0; YY_BUFFER_STATE in = yy_create_buffer(file, YY_BUF_SIZE); yy_switch_to_buffer(in); yyparse(); yy_delete_buffer(in); *err = conf_error; return root_list; } %} %% (" "|\t)+ \n { linec++; } "#"[^\n]*$ [0-9]+ { yylval.number = atoi(yytext); return LEX_INT; } ("true"|"false") { yylval.number = strcmp(yytext, "true") == 0 ? 1 : 0; return LEX_BOOL; } "ip" { return LEX_IP; } "port" { return LEX_PORT; } "client_side_ssl" { return LEX_CSS; } "server" { return LEX_SERVER; } "network" { return LEX_NETWORK; } "host" { return LEX_HOST; } "name" { return LEX_NAME; } "user" { return LEX_USER; } "admin" { return LEX_ADMIN; } "connection" { return LEX_CONNECTION; } "nick" { return LEX_NICK; } "realname" { return LEX_REALNAME; } "default_nick" { return LEX_DEFAULT_NICK; } "default_user" { return LEX_DEFAULT_USER; } "default_realname" { return LEX_DEFAULT_REALNAME; } "source_port" { return LEX_SOURCE_PORT; } "vhost" { return LEX_VHOST; } "password" { return LEX_PASSWORD; } "ssl" { return LEX_SSL; } "ssl_check_mode" { return LEX_SSL_CHECK_MODE; } "ssl_check_store" { return LEX_SSL_CHECK_STORE; } "ssl_client_certfile" { return LEX_SSL_CLIENT_CERTFILE; } "ssl_default_ciphers" { return LEX_DEFAULT_CIPHERS; } "ciphers" { return LEX_CIPHERS; } "key" { return LEX_KEY; } "autojoin_on_kick" { return LEX_AUTOJOIN_ON_KICK; } "channel" { return LEX_CHANNEL; } "log_level" { return LEX_LOG_LEVEL; } "log_root" { return LEX_LOG_ROOT; } "log_format" { return LEX_LOG_FORMAT; } "backlog_lines" { return LEX_BACKLOG_LINES; } "backlog_timestamp" { return LEX_BACKLOG_TIMESTAMP; } "backlog_no_timestamp" { return LEX_BACKLOG_NO_TIMESTAMP; } "backlog" { return LEX_BACKLOG; } "backlog_always" { return LEX_ALWAYS_BACKLOG; } "backlog_msg_only" { return LEX_BL_MSG_ONLY; } "backlog_reset_on_talk" { return LEX_BLRESET_ON_TALK; } "backlog_reset_connection" { return LEX_BLRESET_CONNECTION; } "blreset_on_talk" { return LEX_BLRESET_ON_TALK; } "bl_msg_only" { return LEX_BL_MSG_ONLY; } "always_backlog" { return LEX_ALWAYS_BACKLOG; } "log" { return LEX_LOG; } "log_system" { return LEX_LOG_SYSTEM; } "log_sync_interval" { return LEX_LOG_SYNC_INTERVAL; } "follow_nick" { return LEX_FOLLOW_NICK; } "ignore_first_nick" { return LEX_IGN_FIRST_NICK; } "away_nick" { return LEX_AWAY_NICK; } "on_connect_send" { return LEX_ON_CONNECT_SEND; } "no_client_away_msg" { return LEX_NO_CLIENT_AWAY_MSG; } "pid_file" { return LEX_PID_FILE; } "write_oidentd" { return LEX_WRITE_OIDENTD; } "oidentd_file" { return LEX_OIDENTD_FILE; } "bip_use_notice" { return LEX_BIP_USE_NOTICE; } "client_side_ssl_pem" { return LEX_CSS_PEM; } "client_side_ciphers" { return LEX_CSS_CIPHERS; } "client_side_dh_param" { return LEX_DH_PARAM; } "sasl_username" { return LEX_SASL_USERNAME; } "sasl_password" { return LEX_SASL_PASSWORD; } "sasl_mechanism" { return LEX_SASL_MECHANISM; } "ignore_server_capab" { return LEX_IGNORE_CAPAB; } "reconn_timer" { return LEX_RECONN_TIMER; } \"[^"]*\" { size_t len = strlen(yytext) - 2; yylval.string = bip_malloc(len + 1); memcpy(yylval.string, yytext + 1, len); yylval.string[len] = 0; return LEX_STRING; } "=" { return LEX_EQ; } "{" { return LEX_LBRA; } "}" { return LEX_RBRA; } ";" { return LEX_SEMICOLON; } . { conf_die(_bip, "Parse error in config file line %d, unknown character '%s'", linec + 1, yytext); conf_error = 1; return LEX_BUNCH; } %% bip-0.9.3/src/conf.h0000664000175000017500000002033514212410721011102 00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_YY_CONF_H_INCLUDED # define YY_YY_CONF_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ LEX_IP = 258, /* LEX_IP */ LEX_EQ = 259, /* LEX_EQ */ LEX_PORT = 260, /* LEX_PORT */ LEX_CSS = 261, /* LEX_CSS */ LEX_SEMICOLON = 262, /* LEX_SEMICOLON */ LEX_CONNECTION = 263, /* LEX_CONNECTION */ LEX_NETWORK = 264, /* LEX_NETWORK */ LEX_LBRA = 265, /* LEX_LBRA */ LEX_RBRA = 266, /* LEX_RBRA */ LEX_USER = 267, /* LEX_USER */ LEX_NAME = 268, /* LEX_NAME */ LEX_NICK = 269, /* LEX_NICK */ LEX_SERVER = 270, /* LEX_SERVER */ LEX_PASSWORD = 271, /* LEX_PASSWORD */ LEX_SRCIP = 272, /* LEX_SRCIP */ LEX_HOST = 273, /* LEX_HOST */ LEX_VHOST = 274, /* LEX_VHOST */ LEX_SOURCE_PORT = 275, /* LEX_SOURCE_PORT */ LEX_NONE = 276, /* LEX_NONE */ LEX_COMMENT = 277, /* LEX_COMMENT */ LEX_BUNCH = 278, /* LEX_BUNCH */ LEX_REALNAME = 279, /* LEX_REALNAME */ LEX_SSL = 280, /* LEX_SSL */ LEX_SSL_CHECK_MODE = 281, /* LEX_SSL_CHECK_MODE */ LEX_SSL_CHECK_STORE = 282, /* LEX_SSL_CHECK_STORE */ LEX_SSL_CLIENT_CERTFILE = 283, /* LEX_SSL_CLIENT_CERTFILE */ LEX_CIPHERS = 284, /* LEX_CIPHERS */ LEX_CSS_CIPHERS = 285, /* LEX_CSS_CIPHERS */ LEX_DEFAULT_CIPHERS = 286, /* LEX_DEFAULT_CIPHERS */ LEX_DH_PARAM = 287, /* LEX_DH_PARAM */ LEX_CHANNEL = 288, /* LEX_CHANNEL */ LEX_KEY = 289, /* LEX_KEY */ LEX_LOG_ROOT = 290, /* LEX_LOG_ROOT */ LEX_LOG_FORMAT = 291, /* LEX_LOG_FORMAT */ LEX_LOG_LEVEL = 292, /* LEX_LOG_LEVEL */ LEX_BACKLOG_LINES = 293, /* LEX_BACKLOG_LINES */ LEX_BACKLOG_TIMESTAMP = 294, /* LEX_BACKLOG_TIMESTAMP */ LEX_BACKLOG_NO_TIMESTAMP = 295, /* LEX_BACKLOG_NO_TIMESTAMP */ LEX_BACKLOG = 296, /* LEX_BACKLOG */ LEX_LOG = 297, /* LEX_LOG */ LEX_LOG_SYSTEM = 298, /* LEX_LOG_SYSTEM */ LEX_LOG_SYNC_INTERVAL = 299, /* LEX_LOG_SYNC_INTERVAL */ LEX_FOLLOW_NICK = 300, /* LEX_FOLLOW_NICK */ LEX_ON_CONNECT_SEND = 301, /* LEX_ON_CONNECT_SEND */ LEX_AWAY_NICK = 302, /* LEX_AWAY_NICK */ LEX_PID_FILE = 303, /* LEX_PID_FILE */ LEX_WRITE_OIDENTD = 304, /* LEX_WRITE_OIDENTD */ LEX_OIDENTD_FILE = 305, /* LEX_OIDENTD_FILE */ LEX_IGN_FIRST_NICK = 306, /* LEX_IGN_FIRST_NICK */ LEX_ALWAYS_BACKLOG = 307, /* LEX_ALWAYS_BACKLOG */ LEX_BLRESET_ON_TALK = 308, /* LEX_BLRESET_ON_TALK */ LEX_BLRESET_CONNECTION = 309, /* LEX_BLRESET_CONNECTION */ LEX_DEFAULT_USER = 310, /* LEX_DEFAULT_USER */ LEX_DEFAULT_NICK = 311, /* LEX_DEFAULT_NICK */ LEX_DEFAULT_REALNAME = 312, /* LEX_DEFAULT_REALNAME */ LEX_NO_CLIENT_AWAY_MSG = 313, /* LEX_NO_CLIENT_AWAY_MSG */ LEX_BL_MSG_ONLY = 314, /* LEX_BL_MSG_ONLY */ LEX_ADMIN = 315, /* LEX_ADMIN */ LEX_BIP_USE_NOTICE = 316, /* LEX_BIP_USE_NOTICE */ LEX_CSS_PEM = 317, /* LEX_CSS_PEM */ LEX_AUTOJOIN_ON_KICK = 318, /* LEX_AUTOJOIN_ON_KICK */ LEX_IGNORE_CAPAB = 319, /* LEX_IGNORE_CAPAB */ LEX_RECONN_TIMER = 320, /* LEX_RECONN_TIMER */ LEX_SASL_USERNAME = 321, /* LEX_SASL_USERNAME */ LEX_SASL_PASSWORD = 322, /* LEX_SASL_PASSWORD */ LEX_SASL_MECHANISM = 323, /* LEX_SASL_MECHANISM */ LEX_BOOL = 324, /* LEX_BOOL */ LEX_INT = 325, /* LEX_INT */ LEX_STRING = 326 /* LEX_STRING */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define LEX_IP 258 #define LEX_EQ 259 #define LEX_PORT 260 #define LEX_CSS 261 #define LEX_SEMICOLON 262 #define LEX_CONNECTION 263 #define LEX_NETWORK 264 #define LEX_LBRA 265 #define LEX_RBRA 266 #define LEX_USER 267 #define LEX_NAME 268 #define LEX_NICK 269 #define LEX_SERVER 270 #define LEX_PASSWORD 271 #define LEX_SRCIP 272 #define LEX_HOST 273 #define LEX_VHOST 274 #define LEX_SOURCE_PORT 275 #define LEX_NONE 276 #define LEX_COMMENT 277 #define LEX_BUNCH 278 #define LEX_REALNAME 279 #define LEX_SSL 280 #define LEX_SSL_CHECK_MODE 281 #define LEX_SSL_CHECK_STORE 282 #define LEX_SSL_CLIENT_CERTFILE 283 #define LEX_CIPHERS 284 #define LEX_CSS_CIPHERS 285 #define LEX_DEFAULT_CIPHERS 286 #define LEX_DH_PARAM 287 #define LEX_CHANNEL 288 #define LEX_KEY 289 #define LEX_LOG_ROOT 290 #define LEX_LOG_FORMAT 291 #define LEX_LOG_LEVEL 292 #define LEX_BACKLOG_LINES 293 #define LEX_BACKLOG_TIMESTAMP 294 #define LEX_BACKLOG_NO_TIMESTAMP 295 #define LEX_BACKLOG 296 #define LEX_LOG 297 #define LEX_LOG_SYSTEM 298 #define LEX_LOG_SYNC_INTERVAL 299 #define LEX_FOLLOW_NICK 300 #define LEX_ON_CONNECT_SEND 301 #define LEX_AWAY_NICK 302 #define LEX_PID_FILE 303 #define LEX_WRITE_OIDENTD 304 #define LEX_OIDENTD_FILE 305 #define LEX_IGN_FIRST_NICK 306 #define LEX_ALWAYS_BACKLOG 307 #define LEX_BLRESET_ON_TALK 308 #define LEX_BLRESET_CONNECTION 309 #define LEX_DEFAULT_USER 310 #define LEX_DEFAULT_NICK 311 #define LEX_DEFAULT_REALNAME 312 #define LEX_NO_CLIENT_AWAY_MSG 313 #define LEX_BL_MSG_ONLY 314 #define LEX_ADMIN 315 #define LEX_BIP_USE_NOTICE 316 #define LEX_CSS_PEM 317 #define LEX_AUTOJOIN_ON_KICK 318 #define LEX_IGNORE_CAPAB 319 #define LEX_RECONN_TIMER 320 #define LEX_SASL_USERNAME 321 #define LEX_SASL_PASSWORD 322 #define LEX_SASL_MECHANISM 323 #define LEX_BOOL 324 #define LEX_INT 325 #define LEX_STRING 326 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 74 "conf.y" int number; char *string; void *list; struct tuple *tuple; #line 216 "conf.h" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONF_H_INCLUDED */ bip-0.9.3/src/irc.c0000664000175000017500000023051714212375475010752 00000000000000/* * $Id: irc.c,v 1.156 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "config.h" #include #include #include #include "util.h" #include "irc.h" #include "bip.h" #include "log.h" #include "connection.h" #include "md5.h" #include "utils/base64.h" // TODO resolve assuming signed overflow does not occur when changing X +- C1 // cmp C2 to X cmp C2 -+ C1 #pragma GCC diagnostic ignored "-Wstrict-overflow" #define S_CONN_DELAY (10) extern int sighup; extern bip_t *_bip; static int irc_join(struct link_server *server, struct line *line); static int irc_part(struct link_server *server, struct line *line); static int irc_mode(struct link_server *server, struct line *line); static int irc_mode_channel(struct link_server *s, struct channel *channel, struct line *line, const char *mode, int add, int cur_arg); static int irc_kick(struct link_server *server, struct line *line); static int irc_privmsg(struct link_server *server, struct line *line); static int irc_notice(struct link_server *server, struct line *line); static int irc_quit(struct link_server *server, struct line *line); static int irc_nick(struct link_server *server, struct line *line); static int irc_generic_quit(struct link_server *server, struct line *line); static int irc_topic(struct link_server *server, struct line *line); static int irc_332(struct link_server *server, struct line *line); static int irc_333(struct link_server *server, struct line *line); static int irc_353(struct link_server *server, struct line *line); static int irc_366(struct link_server *server, struct line *line); static int irc_367(struct link_server *server, struct line *l); static int irc_368(struct link_server *server, struct line *l); void irc_server_shutdown(struct link_server *s); static int origin_is_me(struct line *l, struct link_server *server); static void ls_set_nick(struct link_server *ircs, char *nick); static void server_set_chanmodes(struct link_server *l, const char *chanmodes); static void server_set_prefix(struct link_server *l, const char *prefix); static void server_init_modes(struct link_server *s); static int bip_get_index(const char *str, char car); static int bip_fls(long v); void oidentd_dump(bip_t *bip); void irc_client_free(struct link_client *cli); extern int conf_log_sync_interval; extern int conf_reconn_timer; void write_user_list(connection_t *c, char *dest); static void irc_copy_cli(struct link_client *src, struct link_client *dest, struct line *line); static void irc_cli_make_join(struct link_client *ic); static void server_setup_reconnect_timer(struct link *link); int irc_cli_bip(bip_t *bip, struct link_client *ic, struct line *line); static int irc_server_sasl_authenticate(struct link_server *ircs); static char *sasl_mechanism_to_text(int sasl_mechanism); #define LAGOUT_TIME 480 #define LAGCHECK_TIME (90) #define RECONN_TIMER_MAX (600) #define LOGGING_TIMEOUT (360) #define CONN_INTERVAL 60 #define CONNECT_TIMEOUT 60 struct channel *channel_new(const char *name) { struct channel *chan; chan = bip_calloc(sizeof(struct channel), (size_t)1); chan->name = bip_strdup(name); hash_init(&chan->ovmasks, HASH_NOCASE); return chan; } char *nick_from_ircmask(const char *mask) { const char *nick = mask; char *ret; size_t len; if (!mask) return NULL; while (*nick && *nick != '!') nick++; if (!*nick) return bip_strdup(mask); len = (size_t)(nick - mask); // cannot be < 0 ret = bip_malloc(len + 1); memcpy(ret, mask, len); ret[len] = 0; return ret; } #define NAMESIZE 256 list_t *channel_name_list(struct link_server *server, struct channel *c) { list_t *ret; hash_iterator_t hi; size_t len = 0; char *str = bip_malloc((size_t)(NAMESIZE + 1)); ret = list_new(NULL); *str = 0; for (hash_it_init(&c->ovmasks, &hi); hash_it_key(&hi); hash_it_next(&hi)) { const char *nick = hash_it_key(&hi); long int ovmask = (long int)hash_it_item(&hi); assert(strlen(nick) + 2 < NAMESIZE); if (len + strlen(nick) + 2 + (ovmask ? 1 : 0) >= NAMESIZE) { list_add_last(ret, str); str = bip_malloc((size_t)(NAMESIZE + 1)); *str = 0; len = 0; } if (len != 0) { strcat(str, " "); len++; } // prepend symbol corresponding to the usermode int msb; if ((msb = bip_fls(ovmask))) { str[len] = server->prefixes[msb - 1]; str[++len] = 0; } strcat(str, nick); len += strlen(nick); assert(len < NAMESIZE); } list_add_last(ret, str); return ret; } char *link_name(struct link_any *l) { if (LINK(l)) return LINK(l)->name ? LINK(l)->name : "(null)"; return "*connecting*"; } static int irc_001(struct link_server *server, struct line *line) { (void)line; if (LINK(server)->s_state == IRCS_WAS_CONNECTED) LINK(server)->s_state = IRCS_RECONNECTING; else LINK(server)->s_state = IRCS_CONNECTING; /* change nick on client */ unsigned int i; for (i = 0; i < LINK(server)->l_clientc; i++) { struct link_client *c = LINK(server)->l_clientv[i]; WRITE_LINE1(CONN(c), LINK(server)->cli_nick, "NICK", server->nick); } return OK_COPY; } void irc_start_lagtest(struct link_server *l) { l->laginit_ts = time(NULL); write_line_fast(CONN(l), "PING :" S_PING "\r\n"); } /* * returns 0 if we ping timeout */ void irc_compute_lag(struct link_server *is) { time_t lag; assert(is->laginit_ts != -1); lag = time(NULL) - is->laginit_ts; if (lag > LAGOUT_TIME * 2) is->lag = LAGOUT_TIME * 2; else is->lag = (unsigned)lag; } int irc_lags_out(struct link_server *is) { if (is->lag > LAGOUT_TIME) { mylog(LOG_ERROR, "[%s] Lags out! closing", LINK(is)->name); return 1; } else { mylog(LOG_DEBUG, "[%s] lag : %d\n", LINK(is)->name, is->lag); return 0; } } void irc_lag_init(struct link_server *is) { is->lagtest_timeout = LAGCHECK_TIME; is->laginit_ts = -1; } static void irc_server_join(struct link_server *s) { list_iterator_t it; for (list_it_init(&LINK(s)->chan_infos_order, &it); list_it_item(&it); list_it_next(&it)) { struct chan_info *ci = list_it_item(&it); if (!ci->key) WRITE_LINE1(CONN(s), NULL, "JOIN", ci->name); else WRITE_LINE2(CONN(s), NULL, "JOIN", ci->name, ci->key); } } static void irc_server_connected(struct link_server *server) { unsigned int i; LINK(server)->s_state = IRCS_CONNECTED; LINK(server)->s_conn_attempt = 0; mylog(LOG_INFO, "[%s] Connected for user %s", LINK(server)->name, LINK(server)->user->name); irc_server_join(server); log_connected(LINK(server)->log); if (LINK(server)->cli_nick) { /* we change nick on client */ for (i = 0; i < LINK(server)->l_clientc; i++) { struct link_client *ic = LINK(server)->l_clientv[i]; WRITE_LINE1(CONN(ic), LINK(server)->cli_nick, "NICK", server->nick); } free(LINK(server)->cli_nick); LINK(server)->cli_nick = NULL; } /* basic helper for nickserv and co */ list_iterator_t itocs; for (list_it_init(&LINK(server)->on_connect_send, &itocs); list_it_item(&itocs); list_it_next(&itocs)) { size_t len = strlen(list_it_item(&itocs)) + 2; char *str = bip_malloc(len + 1); sprintf(str, "%s\r\n", (char *)list_it_item(&itocs)); write_line(CONN(server), str); free(str); } if (LINK(server)->l_clientc == 0) { if (LINK(server)->away_nick) WRITE_LINE1(CONN(server), NULL, "NICK", LINK(server)->away_nick); if (LINK(server)->no_client_away_msg) WRITE_LINE1(CONN(server), NULL, "AWAY", LINK(server)->no_client_away_msg); } } /* * Given the way irc nets disrespect the rfc, we completely forget * about this damn ircmask... :irc.iiens.net 352 pwet * ~a je.suis.t1r.net irc.iiens.net pwet H :0 d -> nohar!~nohar@haruka.t1r.net */ static int irc_352(struct link_server *server, struct line *line) { (void)server; if (!irc_line_includes(line, 6)) return ERR_PROTOCOL; #if 0 if (irc_line_elem_case_equals(line, 6, server->nick)) { const char *nick = server->nick; const char *iname = irc_line_elem(line, 3); const char *ihost = irc_line_elem(line, 4); char *ircmask = bip_malloc(strlen(nick) + strlen(iname) + strlen(ihost) + 3); strcpy(ircmask, nick); strcat(ircmask, "!"); strcat(ircmask, iname); strcat(ircmask, "@"); strcat(ircmask, ihost); if (server->ircmask) free(server->ircmask); server->ircmask = ircmask; } #endif #if 0 if (!origin_is_me(line, server)) { struct channel *channel; struct nick *nick; channel = hash_get(&server->channels, irc_line_elem(line, 2)); if (!channel) return OK_COPY_WHO; nick = hash_get(&channel->nicks, irc_line_elem(line, 6)); if (!nick) return OK_COPY_WHO; } #endif return OK_COPY_WHO; } static int irc_315(struct link_server *server, struct line *l) { (void)l; struct link *link = LINK(server); if (link->who_client) { if (link->who_client->who_count == 0) { mylog(LOG_DEBUG, "Spurious irc_315"); return OK_COPY_WHO; } link->who_client->whoc_tstamp = time(NULL); if (link->who_client->who_count > 0) { --link->who_client->who_count; mylog(LOG_DEBUG, "RPL_ENDOFWHO: " "Decrementing who count for %p: %d", link->who_client, link->who_client->who_count); } } return OK_COPY_WHO; } void rotate_who_client(struct link *link) { unsigned int i; mylog(LOG_DEBUG, "rotate_who_client %p", link->who_client); /* find a client with non-null who_count */ link->who_client = NULL; for (i = 0; i < link->l_clientc; i++) { struct link_client *ic = link->l_clientv[i]; if (!list_is_empty(&ic->who_queue)) { char *l; while ((l = list_remove_first(&ic->who_queue))) { write_line(CONN(link->l_server), l); free(l); } link->who_client = ic; break; } } } int irc_dispatch_server(bip_t *bip, struct link_server *server, struct line *line) { int ret = OK_COPY; /* shut gcc up */ (void)bip; if (!irc_line_includes(line, 0)) return ERR_PROTOCOL; if (irc_line_elem_equals(line, 0, "PING")) { if (!irc_line_includes(line, 1)) return ERR_PROTOCOL; struct line *resp = irc_line_new(); char *resps; irc_line_append(resp, "PONG"); irc_line_append(resp, irc_line_elem(line, 1)); resp->colon = 1; /* it seems some ircds want it */ resps = irc_line_to_string(resp); write_line_fast(CONN(server), resps); irc_line_free(resp); free(resps); ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "PONG")) { /* not all server reply with PONG * so we blindly assume the PONG is ours. */ if (irc_line_count(line) == 2 || irc_line_count(line) == 3) { if (server->laginit_ts != -1) { irc_compute_lag(server); irc_lag_init(server); } ret = OK_FORGET; } } else if (irc_line_elem_equals(line, 0, "CAP")) { if (LINK(server)->sasl_mechanism) { if (irc_line_elem_equals(line, 2, "ACK") && irc_line_elem_equals(line, 3, "sasl")) { // Server is answering our CAP REQ :sasl and is // SASL capable char *sasl_mech = sasl_mechanism_to_text( LINK(server)->sasl_mechanism); mylog(LOG_INFO, "[%s] Server is SASL capable, starting %s authentication.", LINK(server)->name, sasl_mech); WRITE_LINE1(CONN(server), NULL, "AUTHENTICATE", sasl_mech); ret = OK_FORGET; } else if (irc_line_elem_equals(line, 2, "NAK") && irc_line_elem_equals(line, 3, "sasl")) { // Server is answering our CAP REQ :sasl and // isn't SASL capable mylog(LOG_INFO, "[%s] Server is not SASL capable.", LINK(server)->name); ret = ERR_PROTOCOL; } else { // Unhandled CAP message mylog(LOG_ERROR, "[%s] Unhandled CAP message: %s", LINK(server)->name, irc_line_to_string(line)); ret = OK_FORGET; } } else { // Unhandled CAP message mylog(LOG_ERROR, "[%s] Unhandled CAP message: %s", LINK(server)->name, irc_line_to_string(line)); ret = OK_FORGET; } } else if (irc_line_elem_equals(line, 0, "AUTHENTICATE")) { if (LINK(server)->sasl_mechanism) { if (irc_line_count(line) == 2 && irc_line_elem_equals(line, 1, "+")) { // Server is waiting for us to authenticate, // let's do it mylog(LOG_INFO, "[%s] Server accepted our authentication mechanism.", LINK(server)->name); ret = irc_server_sasl_authenticate(server); } else { // Anything else than "AUTHENTICATE +" is // unknown to us mylog(LOG_ERROR, "[%s] Server sent gibberish: %s", LINK(server)->name, irc_line_to_string(line)); ret = ERR_PROTOCOL; } } else { // Unhandled AUTHENTICATE message mylog(LOG_ERROR, "[%s] Unhandled AUTHENTICATE message: %s", LINK(server)->name, irc_line_to_string(line)); ret = OK_FORGET; } } else if (irc_line_elem_equals(line, 0, "900")) { if (irc_line_count(line) >= 5) { mylog(LOG_INFO, "[%s] Logged in as %s(%s): %s", LINK(server)->name, irc_line_elem(line, 3), irc_line_elem(line, 2), irc_line_elem(line, 4)); } else { mylog(LOG_INFO, "[%s] Logged in: %s", LINK(server)->name, irc_line_to_string(line)); } ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "901")) { if (irc_line_count(line) >= 4) { mylog(LOG_INFO, "[%s] Logged out: %s", LINK(server)->name, irc_line_elem(line, 3)); } else { mylog(LOG_INFO, "[%s] Logged out: %s", LINK(server)->name, irc_line_to_string(line)); } ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "902")) { mylog(LOG_INFO, "[%s] Account unavailable: %s", LINK(server)->name, irc_line_to_string(line)); ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "903")) { mylog(LOG_INFO, "[%s] SASL authentication successful", LINK(server)->name); WRITE_LINE1(CONN(server), NULL, "CAP", "END"); ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "904")) { mylog(LOG_ERROR, "[%s] SASL authentication failed", LINK(server)->name); ret = ERR_AUTH; } else if (irc_line_elem_equals(line, 0, "905")) { mylog(LOG_ERROR, "[%s] SASL message too long", LINK(server)->name); ret = ERR_AUTH; } else if (irc_line_elem_equals(line, 0, "906")) { mylog(LOG_ERROR, "[%s] SASL authentication aborted by client", LINK(server)->name); ret = ERR_AUTH; } else if (irc_line_elem_equals(line, 0, "907")) { mylog(LOG_ERROR, "[%s] SASL authentication has already been completed", LINK(server)->name); ret = OK_FORGET; } else if (irc_line_elem_equals(line, 0, "908")) { mylog(LOG_ERROR, "[%s] Server only accepts following authentication mechanisms: %s", LINK(server)->name, irc_line_elem(line, 2)); ret = ERR_AUTH; } else if (irc_line_elem_equals(line, 0, "433")) { if (LINK(server)->s_state != IRCS_CONNECTED) { size_t nicklen = strlen(server->nick); char *newnick = bip_malloc(nicklen + 2); strcpy(newnick, server->nick); if (strlen(server->nick) < 9) { strcat(newnick, "`"); } else { if (newnick[7] != '`') { if (newnick[8] != '`') { newnick[8] = '`'; } else { newnick[7] = '`'; } } else { newnick[8] = (char)('a' + ('z' - 'a') * rand() / RAND_MAX); } newnick[9] = 0; } ls_set_nick(server, newnick); WRITE_LINE1(CONN(server), NULL, "NICK", server->nick); ret = OK_FORGET; } } else if (LINK(server)->s_state == IRCS_RECONNECTING) { ret = OK_FORGET; if (irc_line_elem_equals(line, 0, "376")) /* end of motd */ irc_server_connected(server); else if (irc_line_elem_equals(line, 0, "422")) /* no motd */ irc_server_connected(server); } else if (LINK(server)->s_state == IRCS_CONNECTING) { ret = OK_FORGET; if (irc_line_elem_equals(line, 0, "005")) { int i; for (i = irc_line_count(line) - 1; i > 0; i--) { if (LINK(server)->ignore_server_capab && irc_line_elem_equals(line, i, "CAPAB")) irc_line_drop(line, i); else if (!strncmp(irc_line_elem(line, i), "CHANMODES=", (size_t)10)) server_set_chanmodes( server, irc_line_elem(line, i) + 10); else if (!strncmp(irc_line_elem(line, i), "PREFIX=(", (size_t)8)) server_set_prefix(server, irc_line_elem(line, i) + 7); } } if (irc_line_elem_equals(line, 0, "NOTICE")) { } else if (irc_line_elem_equals(line, 0, "376")) { /* end of motd */ irc_server_connected(server); list_add_last(&LINK(server)->init_strings, irc_line_dup(line)); } else if (irc_line_elem_equals(line, 0, "422")) { /* no motd */ irc_server_connected(server); list_add_last(&LINK(server)->init_strings, irc_line_dup(line)); } else { list_add_last(&LINK(server)->init_strings, irc_line_dup(line)); } } else if (irc_line_elem_equals(line, 0, "001")) { ret = irc_001(server, line); if (LINK(server)->s_state == IRCS_CONNECTING) { if (!list_is_empty(&LINK(server)->init_strings)) return ERR_PROTOCOL; /* update the irc mask */ list_add_last(&LINK(server)->init_strings, irc_line_dup(line)); } } else if (irc_line_elem_equals(line, 0, "JOIN")) { ret = irc_join(server, line); } else if (irc_line_elem_equals(line, 0, "332")) { ret = irc_332(server, line); } else if (irc_line_elem_equals(line, 0, "333")) { ret = irc_333(server, line); } else if (irc_line_elem_equals(line, 0, "352")) { ret = irc_352(server, line); } else if (irc_line_elem_equals(line, 0, "315")) { ret = irc_315(server, line); } else if (irc_line_elem_equals(line, 0, "353")) { ret = irc_353(server, line); } else if (irc_line_elem_equals(line, 0, "366")) { ret = irc_366(server, line); } else if (irc_line_elem_equals(line, 0, "367")) { ret = irc_367(server, line); } else if (irc_line_elem_equals(line, 0, "368")) { ret = irc_368(server, line); } else if (irc_line_elem_equals(line, 0, "PART")) { ret = irc_part(server, line); } else if (irc_line_elem_equals(line, 0, "MODE")) { ret = irc_mode(server, line); } else if (irc_line_elem_equals(line, 0, "TOPIC")) { ret = irc_topic(server, line); } else if (irc_line_elem_equals(line, 0, "KICK")) { ret = irc_kick(server, line); } else if (irc_line_elem_equals(line, 0, "PRIVMSG")) { ret = irc_privmsg(server, line); } else if (irc_line_elem_equals(line, 0, "NOTICE")) { ret = irc_notice(server, line); } else if (irc_line_elem_equals(line, 0, "QUIT")) { ret = irc_quit(server, line); } else if (irc_line_elem_equals(line, 0, "NICK")) { ret = irc_nick(server, line); } if (ret == OK_COPY) { unsigned int i; for (i = 0; i < LINK(server)->l_clientc; i++) { if (TYPE(LINK(server)->l_clientv[i]) == IRC_TYPE_CLIENT) { char *s = irc_line_to_string(line); write_line(CONN(LINK(server)->l_clientv[i]), s); free(s); } } } if (ret == OK_COPY_WHO && LINK(server)->who_client) { char *s; s = irc_line_to_string(line); write_line(CONN(LINK(server)->who_client), s); free(s); } if (LINK(server)->who_client && LINK(server)->who_client->who_count == 0) { mylog(LOG_DEBUG, "OK_COPY_WHO: who_count for %p is nul", LINK(server)->who_client); rotate_who_client(LINK(server)); } return ret; } /* send join and related stuff to client */ static void irc_send_join(struct link_client *ic, struct channel *chan) { struct bipuser *user; char *ircmask; user = LINK(ic)->user; assert(user); /* user ircmask here for rbot */ ircmask = bip_malloc(strlen(LINK(ic)->l_server->nick) + strlen(BIP_FAKEMASK) + 1); strcpy(ircmask, LINK(ic)->l_server->nick); strcat(ircmask, BIP_FAKEMASK); WRITE_LINE1(CONN(ic), ircmask, "JOIN", chan->name); free(ircmask); if (chan->topic) WRITE_LINE3(CONN(ic), P_SERV, "332", LINK(ic)->l_server->nick, chan->name, chan->topic); if (chan->creator && chan->create_ts) WRITE_LINE4(CONN(ic), P_SERV, "333", LINK(ic)->l_server->nick, chan->name, chan->creator, chan->create_ts); list_t *name_list = channel_name_list(LINK(ic)->l_server, chan); char *s; while ((s = list_remove_first(name_list))) { char tmptype[2]; tmptype[0] = chan->type; tmptype[1] = 0; WRITE_LINE4(CONN(ic), P_SERV, "353", LINK(ic)->l_server->nick, tmptype, chan->name, s); free(s); } list_free(name_list); WRITE_LINE3(CONN(ic), P_SERV, "366", LINK(ic)->l_server->nick, chan->name, "End of /NAMES list."); } static void write_init_string(connection_t *c, struct line *line, char *nick) { char *l; l = irc_line_to_string_to(line, nick); write_line(c, l); free(l); } static void bind_to_link(struct link *l, struct link_client *ic) { unsigned int i = l->l_clientc; LINK(ic) = l; l->l_clientc++; l->l_clientv = bip_realloc(l->l_clientv, l->l_clientc * sizeof(struct link_client *)); l->l_clientv[i] = ic; } void unbind_from_link(struct link_client *ic) { struct link *l = LINK(ic); unsigned int i; for (i = 0; i < l->l_clientc; i++) if (l->l_clientv[i] == ic) break; assert(i != l->l_clientc); if (l->who_client == ic) { mylog(LOG_DEBUG, "unbind_from_link: %p: %d", l->who_client, ic->who_count); l->who_client = NULL; } for (i = i + 1; i < l->l_clientc; i++) l->l_clientv[i - 1] = l->l_clientv[i]; if (l->l_clientc == 0) fatal("unbind_from_link: negative client count"); l->l_clientc--; l->l_clientv = bip_realloc(l->l_clientv, l->l_clientc * sizeof(struct link_client *)); if (l->l_clientc == 0) { /* bip_realloc was equiv to free() */ l->l_clientv = NULL; return; } } int irc_cli_bip(bip_t *bip, struct link_client *ic, struct line *line) { return adm_bip(bip, ic, line, 0); } #define PASS_SEP ':' static char *get_str_elem(char *str, int num) { char *ret; char *c; char *cur = str; int index = 0; while ((c = strchr(cur, PASS_SEP))) { long len = c - cur; if (index < num) { index++; cur = c + 1; continue; } if (len < 1) return NULL; // len always > 0 ret = bip_malloc((size_t)len + 1); memcpy(ret, cur, (size_t)len); ret[len] = 0; return ret; } if (index == num) { long len; c = str + strlen(str); len = c - cur; if (len < 1) return NULL; ret = bip_malloc((size_t)len + 1); memcpy(ret, cur, (size_t)len); ret[len] = 0; return ret; } return NULL; } static void irc_cli_make_join(struct link_client *ic) { if (LINK(ic)->l_server) { /* join channels, step one, those in conf, in order */ list_iterator_t li; for (list_it_init(&LINK(ic)->chan_infos_order, &li); list_it_item(&li); list_it_next(&li)) { struct chan_info *ci = (struct chan_info *)list_it_item(&li); struct channel *chan; if ((chan = hash_get(&LINK(ic)->l_server->channels, ci->name))) irc_send_join(ic, chan); } /* step two, those not in conf */ hash_iterator_t hi; for (hash_it_init(&LINK(ic)->l_server->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) { struct channel *chan = (struct channel *)hash_it_item(&hi); if (!hash_get(&LINK(ic)->chan_infos, chan->name)) irc_send_join(ic, chan); } } } void irc_cli_backlog(struct link_client *ic, int hours) { struct bipuser *user; user = LINK(ic)->user; assert(user); assert(LINK(ic)->l_server); if (!user->backlog) { mylog(LOG_DEBUG, "Backlog disabled for %s, not backlogging", user->name); return; } if (hours != 0) { /* have some limit */ if (hours > 24 * 366) hours = 24 * 366; } list_t *backlogl; char *bl; list_t *bllines; backlogl = log_backlogs(LINK(ic)->log); while ((bl = list_remove_first(backlogl))) { bllines = backlog_lines(LINK(ic)->log, bl, LINK(ic)->l_server->nick, hours); if (bllines) { if (!list_is_empty(bllines)) { mylog(LOG_INFO, "[%s] backlogging: %s", LINK(ic)->name, bl); write_lines(CONN(ic), bllines); } list_free(bllines); } free(bl); } list_free(backlogl); } static int irc_cli_startup(bip_t *bip, struct link_client *ic, struct line *line) { char *init_nick; char *user, *pass, *connname; (void)line; assert(ic->init_pass); user = get_str_elem(ic->init_pass, 0); if (!user) return ERR_AUTH; pass = get_str_elem(ic->init_pass, 1); if (!pass) { free(user); return ERR_AUTH; } connname = get_str_elem(ic->init_pass, 2); if (!connname) { free(pass); free(user); return ERR_AUTH; } list_iterator_t it; for (list_it_init(&bip->link_list, &it); list_it_item(&it); list_it_next(&it)) { struct link *l = list_it_item(&it); if (strcmp(user, l->user->name) == 0 && strcmp(connname, l->name) == 0) { if (chash_cmp(pass, l->user->password, l->user->seed) == 0) { bind_to_link(l, ic); break; } } } if (!LINK(ic)) mylog(LOG_ERROR, "[%s] Invalid credentials (user: %s)", connname, user); free(user); free(connname); free(pass); free(ic->init_pass); ic->init_pass = NULL; init_nick = ic->init_nick; ic->init_nick = NULL; if (!LINK(ic)) { free(init_nick); return ERR_AUTH; } #ifdef HAVE_LIBSSL if (LINK(ic)->s_state != IRCS_CONNECTED) { /* Check if we have an untrusted certificate from the server */ if (ssl_check_trust(ic)) { free(init_nick); return OK_FORGET; } } #endif if (LINK(ic)->s_state == IRCS_NONE) { /* drop it if corresponding server hasn't connected at all. */ write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":ERROR Proxy not yet connected, try again " "later\r\n"); unbind_from_link(ic); free(init_nick); return OK_CLOSE; } list_remove(&bip->connecting_client_list, ic); TYPE(ic) = IRC_TYPE_CLIENT; for (list_it_init(&LINK(ic)->init_strings, &it); list_it_item(&it); list_it_next(&it)) write_init_string(CONN(ic), list_it_item(&it), init_nick); /* we change nick on server */ if (LINK(ic)->l_server) { struct link_server *server = LINK(ic)->l_server; WRITE_LINE1(CONN(ic), init_nick, "NICK", server->nick); if (!LINK(ic)->ignore_first_nick) WRITE_LINE1(CONN(server), NULL, "NICK", init_nick); else if (LINK(ic)->away_nick && strcmp(LINK(ic)->away_nick, server->nick) == 0) WRITE_LINE1(CONN(server), NULL, "NICK", LINK(server)->connect_nick); /* change away status */ if (server && LINK(ic)->no_client_away_msg) WRITE_LINE0(CONN(server), NULL, "AWAY"); } if (!LINK(ic)->l_server) { free(init_nick); return OK_FORGET; } irc_cli_make_join(ic); irc_cli_backlog(ic, 0); log_client_connected(LINK(ic)->log); free(init_nick); return OK_FORGET; } static int irc_cli_nick(bip_t *bip, struct link_client *ic, struct line *line) { if (irc_line_count(line) != 2) return ERR_PROTOCOL; if ((ic->state & IRCC_READY) == IRCC_READY) return OK_COPY; ic->state |= IRCC_NICK; if (ic->init_nick) free(ic->init_nick); ic->init_nick = bip_strdup(irc_line_elem(line, 1)); if ((ic->state & IRCC_READY) == IRCC_READY) return irc_cli_startup(bip, ic, line); if ((ic->state & IRCC_PASS) != IRCC_PASS) WRITE_LINE2(CONN(ic), P_SERV, "NOTICE", ic->init_nick, "You should type /QUOTE PASS your_username:" "your_password:your_connection_name"); return OK_FORGET; } static int irc_cli_user(bip_t *bip, struct link_client *ic, struct line *line) { if (irc_line_count(line) != 5) return ERR_PROTOCOL; if ((ic->state & IRCC_READY) == IRCC_READY) return ERR_PROTOCOL; ic->state |= IRCC_USER; if ((ic->state & IRCC_READY) == IRCC_READY) return irc_cli_startup(bip, ic, line); return OK_FORGET; } static int irc_cli_pass(bip_t *bip, struct link_client *ic, struct line *line) { if (irc_line_count(line) != 2) return ERR_PROTOCOL; if ((ic->state & IRCC_READY) == IRCC_READY) return ERR_PROTOCOL; ic->state |= IRCC_PASS; if (ic->init_pass) free(ic->init_pass); ic->init_pass = bip_strdup(irc_line_elem(line, 1)); if ((ic->state & IRCC_READY) == IRCC_READY) return irc_cli_startup(bip, ic, line); return OK_FORGET; } static int irc_cli_quit(struct link_client *ic, struct line *line) { (void)ic; (void)line; return OK_CLOSE; } static int irc_cli_privmsg(bip_t *bip, struct link_client *ic, struct line *line) { if (!irc_line_includes(line, 2)) return OK_FORGET; if (irc_line_elem_equals(line, 1, "-bip")) return adm_bip(bip, ic, line, 1); else log_cli_privmsg(LINK(ic)->log, LINK(ic)->l_server->nick, irc_line_elem(line, 1), irc_line_elem(line, 2)); if (LINK(ic)->user->blreset_on_talk) { if (LINK(ic)->user->blreset_connection) log_reset_all(LINK(ic)->log); else log_reset_store(LINK(ic)->log, irc_line_elem(line, 1)); } return OK_COPY_CLI; } static int irc_cli_notice(struct link_client *ic, struct line *line) { if (!irc_line_includes(line, 2)) return OK_FORGET; log_cli_notice(LINK(ic)->log, LINK(ic)->l_server->nick, irc_line_elem(line, 1), irc_line_elem(line, 2)); if (LINK(ic)->user->blreset_on_talk) { if (LINK(ic)->user->blreset_connection) log_reset_all(LINK(ic)->log); else log_reset_store(LINK(ic)->log, irc_line_elem(line, 1)); } return OK_COPY_CLI; } static int irc_cli_who(struct link_client *ic, struct line *line) { struct link *l = LINK(ic); ++ic->who_count; if (ic->who_count == 1) ic->whoc_tstamp = time(NULL); mylog(LOG_DEBUG, "cli_who: Incrementing who count for %p: %d", ic, ic->who_count); if (l->who_client && l->who_client != ic) { list_add_first(&ic->who_queue, irc_line_to_string(line)); return OK_FORGET; } if (!l->who_client) l->who_client = ic; return OK_COPY; } static int irc_cli_mode(struct link_client *ic, struct line *line) { struct link *l = LINK(ic); if (irc_line_count(line) != 3) return OK_COPY; /* This is a wild guess and that sucks. */ if (!irc_line_elem_equals(line, 0, "MODE") || strchr(irc_line_elem(line, 2), 'b') == NULL) return OK_COPY; ++ic->who_count; if (ic->who_count == 1) ic->whoc_tstamp = time(NULL); mylog(LOG_DEBUG, "cli_mode: Incrementing who count for %p: %d", l->who_client, ic->who_count); if (l->who_client && l->who_client != ic) { list_add_first(&ic->who_queue, irc_line_to_string(line)); return OK_FORGET; } if (!l->who_client) l->who_client = ic; return OK_COPY; } static void irc_notify_disconnection(struct link_server *is) { unsigned int i; LINK(is)->cli_nick = bip_strdup(is->nick); for (i = 0; i < LINK(is)->l_clientc; i++) { struct link_client *ic = LINK(is)->l_clientv[i]; hash_iterator_t hi; for (hash_it_init(&is->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) { struct channel *c = (struct channel *)hash_it_item(&hi); WRITE_LINE3(CONN(ic), P_IRCMASK, "KICK", c->name, is->nick, "Server disconnected, reconnecting"); } bip_notify(ic, "Server disconnected, reconnecting"); } } void irc_add_channel_info(struct link_server *ircs, const char *chan, const char *key) { struct chan_info *ci; // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (!ischannel(*chan)) return; #pragma GCC diagnostic pop ci = hash_get(&LINK(ircs)->chan_infos, chan); if (!ci) { ci = chan_info_new(); ci->name = bip_strdup(chan); ci->key = key ? bip_strdup(key) : NULL; ci->backlog = 1; hash_insert(&LINK(ircs)->chan_infos, chan, ci); list_add_last(&LINK(ircs)->chan_infos_order, ci); } else { if (ci->key) { free(ci->key); ci->key = NULL; } ci->key = key ? bip_strdup(key) : NULL; } } static int irc_cli_join(struct link_client *irc, struct line *line) { if (irc_line_count(line) != 2 && irc_line_count(line) != 3) return ERR_PROTOCOL; const char *s, *e, *ks, *ke = NULL; s = irc_line_elem(line, 1); if (irc_line_count(line) == 3) ks = irc_line_elem(line, 2); else ks = NULL; while ((e = strchr(s, ','))) { size_t len = (size_t)(e - s); // cannot be < 0 or NULL per while char *p = bip_malloc(len + 1); size_t klen; char *kp = NULL; memcpy(p, s, len); p[len] = 0; if (ks) { if (strlen(ks)) { ke = strchr(ks, ','); if (!ke) ke = ks + strlen(ks); klen = (size_t)(ke - ks); kp = bip_malloc(klen + 1); memcpy(kp, ks, klen); kp[klen] = 0; if (*ke == 0) ks = NULL; } else { kp = NULL; ks = NULL; } } irc_add_channel_info(LINK(irc)->l_server, p, kp); free(p); if (kp) { free(kp); if (ks) ks = ke + 1; } s = e + 1; } irc_add_channel_info(LINK(irc)->l_server, s, ks); return OK_COPY; } static int irc_cli_part(struct link_client *irc, struct line *line) { struct chan_info *ci; const char *cname; if (irc_line_count(line) != 2 && irc_line_count(line) != 3) return ERR_PROTOCOL; cname = irc_line_elem(line, 1); if ((ci = hash_remove_if_exists(&LINK(irc)->chan_infos, cname)) != NULL) { list_remove(&LINK(irc)->chan_infos_order, ci); free(ci->name); if (ci->key) free(ci->key); free(ci); } return OK_COPY; } #ifdef HAVE_LIBSSL static int irc_dispatch_trust_client(struct link_client *ic, struct line *line) { int r = OK_COPY; if (!irc_line_includes(line, 1)) return ERR_PROTOCOL; if (strcasecmp(irc_line_elem(line, 0), "BIP") == 0 && strcasecmp(irc_line_elem(line, 1), "TRUST") == 0) r = adm_trust(ic, line); return r; } #endif static int irc_dispatch_client(bip_t *bip, struct link_client *ic, struct line *line) { int r = OK_COPY; if (irc_line_count(line) == 0) return ERR_PROTOCOL; if (irc_line_elem_equals(line, 0, "PING")) { if (!irc_line_includes(line, 1)) return ERR_PROTOCOL; WRITE_LINE1(CONN(ic), link_name((struct link_any *)ic), "PONG", irc_line_elem(line, 1)); r = OK_FORGET; } else if (LINK(ic)->s_state != IRCS_CONNECTED) { write_line_fast(CONN(ic), ":irc.bip.net NOTICE pouet " ":ERROR Proxy not connected, please wait " "before sending commands\r\n"); r = OK_FORGET; } else if (strcasecmp(irc_line_elem(line, 0), "BIP") == 0) { r = irc_cli_bip(bip, ic, line); } else if (irc_line_elem_equals(line, 0, "JOIN")) { r = irc_cli_join(ic, line); } else if (irc_line_elem_equals(line, 0, "PART")) { r = irc_cli_part(ic, line); } else if (irc_line_elem_equals(line, 0, "NICK")) { r = irc_cli_nick(bip, ic, line); } else if (irc_line_elem_equals(line, 0, "QUIT")) { r = irc_cli_quit(ic, line); } else if (irc_line_elem_equals(line, 0, "PRIVMSG")) { r = irc_cli_privmsg(bip, ic, line); } else if (irc_line_elem_equals(line, 0, "NOTICE")) { r = irc_cli_notice(ic, line); } else if (irc_line_elem_equals(line, 0, "WHO")) { r = irc_cli_who(ic, line); } else if (irc_line_elem_equals(line, 0, "MODE")) { r = irc_cli_mode(ic, line); } if (r == OK_COPY || r == OK_COPY_CLI) { char *str = irc_line_to_string(line); if (LINK(ic)->s_state == IRCS_CONNECTED && LINK(ic)->l_server->nick) write_line(CONN(LINK(ic)->l_server), str); else if (LINK(ic)->l_server->nick) WRITE_LINE2(CONN(ic), P_IRCMASK, (LINK(ic)->user->bip_use_notice ? "NOTICE" : "PRIVMSG"), LINK(ic)->l_server->nick, ":Not connected please try again " "later...\r\n"); free(str); if (r == OK_COPY_CLI) { unsigned int i; struct link_server *s = LINK(ic)->l_server; for (i = 0; i < LINK(s)->l_clientc; i++) irc_copy_cli(ic, LINK(s)->l_clientv[i], line); } } return r; } static void irc_copy_cli(struct link_client *src, struct link_client *dest, struct line *line) { char *str; if (src == dest) return; if (!irc_line_includes(line, 1) || !irc_line_elem_equals(line, 0, "PRIVMSG")) { str = irc_line_to_string(line); write_line(CONN(dest), str); free(str); return; } // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (ischannel(*irc_line_elem(line, 1)) || LINK(src) != LINK(dest)) { assert(!line->origin); line->origin = LINK(src)->l_server->nick; str = irc_line_to_string(line); line->origin = NULL; write_line(CONN(dest), str); free(str); return; } #pragma GCC diagnostic pop /* LINK(src) == LINK(dest) */ size_t len = strlen(irc_line_elem(line, 2)) + 6; // snprintf fix ^ // ‘__builtin___snprintf_chk’ output may be truncated before the last // format character char *tmp; if (len == 0) return; tmp = bip_malloc(len); snprintf(tmp, len, " -> %s", irc_line_elem(line, 2)); tmp[len - 1] = 0; struct line *retline = irc_line_new(); retline->origin = bip_strdup(irc_line_elem(line, 1)); irc_line_append(retline, irc_line_elem(line, 0)); irc_line_append(retline, LINK(src)->l_server->nick); irc_line_append(retline, tmp); free(tmp); str = irc_line_to_string(retline); irc_line_free(retline); #if 0 /* tricky: */ irc_line_elem(line, 1) = LINK(src)->l_server->nick; oldelem = irc_line_elem(line, 2); irc_line_elem(line, 2) = tmp; str = irc_line_to_string(line); /* end of trick: */ irc_line_elem(line, 1) = line->origin; irc_line_elem(line, 2) = oldelem; line->origin = NULL; #endif write_line(CONN(dest), str); free(str); return; } static int irc_dispatch_logging_client(bip_t *bip, struct link_client *ic, struct line *line) { if (irc_line_count(line) == 0) return ERR_PROTOCOL; if (irc_line_elem_equals(line, 0, "NICK")) { return irc_cli_nick(bip, ic, line); } else if (irc_line_elem_equals(line, 0, "USER")) { return irc_cli_user(bip, ic, line); } else if (irc_line_elem_equals(line, 0, "PASS")) { return irc_cli_pass(bip, ic, line); } return OK_FORGET; } int irc_dispatch(bip_t *bip, struct link_any *l, struct line *line) { switch (TYPE(l)) { case IRC_TYPE_SERVER: return irc_dispatch_server(bip, (struct link_server *)l, line); break; case IRC_TYPE_CLIENT: return irc_dispatch_client(bip, (struct link_client *)l, line); break; case IRC_TYPE_LOGGING_CLIENT: return irc_dispatch_logging_client(bip, (struct link_client *)l, line); break; #ifdef HAVE_LIBSSL case IRC_TYPE_TRUST_CLIENT: return irc_dispatch_trust_client((struct link_client *)l, line); break; #endif default: fatal("irc_dispatch: unknown IRC_TYPE_SERVER"); } return ERR_PROTOCOL; /* never reached */ } static int origin_is_me(struct line *l, struct link_server *server) { char *nick; if (!l->origin) return 0; nick = nick_from_ircmask(l->origin); if (!nick) return 0; if (strcasecmp(nick, server->nick) == 0) { free(nick); return 1; } free(nick); return 0; } static int irc_join(struct link_server *server, struct line *line) { char *s_nick; const char *s_chan; struct channel *channel; if (irc_line_count(line) != 2 && irc_line_count(line) != 3) return ERR_PROTOCOL; s_chan = irc_line_elem(line, 1); log_join(LINK(server)->log, line->origin, s_chan); channel = hash_get(&server->channels, s_chan); if (origin_is_me(line, server)) { if (!channel) { channel = channel_new(s_chan); hash_insert(&server->channels, s_chan, channel); } return OK_COPY; } /* if we're not on channel and !origin_is_me, we should not get any * JOIN */ if (!channel) return ERR_PROTOCOL; if (!line->origin) return ERR_PROTOCOL; s_nick = nick_from_ircmask(line->origin); // should not happen if (!s_nick) return ERR_PROTOCOL; hash_insert(&channel->ovmasks, s_nick, 0); free(s_nick); return OK_COPY; } static int irc_332(struct link_server *server, struct line *line) { struct channel *channel; if (irc_line_count(line) != 4) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 2)); /* we can get topic reply for chans we're not on */ if (!channel) return OK_COPY; if (channel->topic) free(channel->topic); channel->topic = bip_strdup(irc_line_elem(line, 3)); log_init_topic(LINK(server)->log, channel->name, channel->topic); return OK_COPY; } static int irc_333(struct link_server *server, struct line *line) { struct channel *channel; if (!irc_line_includes(line, 2)) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 2)); /* we can get topic info reply for chans we're not on */ if (!channel) return OK_COPY; if (channel->creator) free(channel->creator); if (channel->create_ts) free(channel->create_ts); if (irc_line_count(line) == 5) { channel->creator = bip_strdup(irc_line_elem(line, 3)); channel->create_ts = bip_strdup(irc_line_elem(line, 4)); } else { channel->creator = bip_strdup(""); channel->create_ts = bip_strdup("0"); } log_init_topic_time(LINK(server)->log, channel->name, channel->creator, channel->create_ts); return OK_COPY; } static int irc_353(struct link_server *server, struct line *line) { struct channel *channel; const char *names, *eon; size_t len; char *nick; if (irc_line_count(line) != 5) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 3)); /* we can get names reply for chans we're not on */ if (!channel) return OK_COPY; if (!channel->running_names) { channel->running_names = 1; hash_clean(&channel->ovmasks); } /* TODO check that type is one of "=" / "*" / "@" */ channel->type = irc_line_elem(line, 2)[0]; names = irc_line_elem(line, 4); int index; while (*names) { long int ovmask = 0; /* some ircds (e.g. unreal) may display several flags for the same nick */ // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" while ((index = bip_get_index(server->prefixes, *names))) { ovmask |= 1 << index; names++; } #pragma GCC diagnostic pop eon = names; while (*eon && *eon != ' ') eon++; len = (size_t)(eon - names); // cannot be < 0 nick = bip_malloc(len + 1); memcpy(nick, names, len); nick[len] = 0; /* we just ignore names for nicks that are crazy long */ if (len + 2 < NAMESIZE) hash_insert(&channel->ovmasks, nick, (void *)ovmask); free(nick); while (*eon && *eon == ' ') eon++; names = eon; } return OK_COPY; } static int irc_366(struct link_server *server, struct line *line) { struct channel *channel; if (irc_line_count(line) != 4) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 2)); if (channel && channel->running_names) channel->running_names = 0; return OK_COPY; } static int irc_367(struct link_server *server, struct line *l) { (void)server; (void)l; return OK_COPY_WHO; } /* same as irc_315 */ static int irc_368(struct link_server *server, struct line *l) { (void)l; struct link *link = LINK(server); if (link->who_client) { if (link->who_client->who_count == 0) { mylog(LOG_DEBUG, "Spurious irc_368"); return OK_COPY_WHO; } link->who_client->whoc_tstamp = time(NULL); if (link->who_client->who_count > 0) { --link->who_client->who_count; mylog(LOG_DEBUG, "RPL_ENDOFBANLIST: " "Decrementing who count for %p: %d", link->who_client, link->who_client->who_count); } } return OK_COPY_WHO; } static void channel_free(struct channel *c) { if (c->name) free(c->name); if (c->mode) free(c->mode); if (c->key) free(c->key); if (c->topic) free(c->topic); if (c->creator) free(c->creator); if (c->create_ts) free(c->create_ts); hash_clean(&c->ovmasks); free(c); } static int irc_part(struct link_server *server, struct line *line) { char *s_nick; const char *s_chan; struct channel *channel; if (irc_line_count(line) != 2 && irc_line_count(line) != 3) return ERR_PROTOCOL; s_chan = irc_line_elem(line, 1); channel = hash_get(&server->channels, s_chan); /* we can't get part message for chans we're not on */ if (!channel) return ERR_PROTOCOL; if (origin_is_me(line, server)) { log_part(LINK(server)->log, line->origin, s_chan, irc_line_count(line) == 3 ? irc_line_elem(line, 2) : NULL); log_reset_store(LINK(server)->log, s_chan); log_drop(LINK(server)->log, s_chan); hash_remove(&server->channels, s_chan); channel_free(channel); return OK_COPY; } if (!line->origin) return ERR_PROTOCOL; s_nick = nick_from_ircmask(line->origin); // should not happen if (!s_nick) return ERR_PROTOCOL; if (!hash_includes(&channel->ovmasks, s_nick)) { free(s_nick); return ERR_PROTOCOL; } hash_remove(&channel->ovmasks, s_nick); free(s_nick); log_part(LINK(server)->log, line->origin, s_chan, irc_line_count(line) == 3 ? irc_line_elem(line, 2) : NULL); return OK_COPY; } static void mode_add_letter_uniq(struct link_server *s, char c) { size_t i; for (i = 0; i < s->user_mode_len; i++) { if (s->user_mode[i] == c) return; } s->user_mode = bip_realloc(s->user_mode, s->user_mode_len + 1); s->user_mode[s->user_mode_len++] = c; } static void mode_remove_letter(struct link_server *s, char c) { size_t i; for (i = 0; i < s->user_mode_len; i++) { if (s->user_mode[i] == c) { for (; i < s->user_mode_len - 1; i++) s->user_mode[i] = s->user_mode[i + 1]; s->user_mode_len--; s->user_mode = bip_realloc(s->user_mode, s->user_mode_len); return; } } } static void irc_user_mode(struct link_server *server, struct line *line) { const char *mode; int add = 1; for (mode = irc_line_elem(line, 2); *mode; mode++) { if (*mode == '-') add = 0; else if (*mode == '+') add = 1; else { // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (add) { mode_add_letter_uniq(server, *mode); } else { mode_remove_letter(server, *mode); } #pragma GCC diagnostic pop } } } static int irc_mode(struct link_server *server, struct line *line) { struct channel *channel; const char *mode; int add = 1; int cur_arg = 0; array_t *mode_args = NULL; int ret; if (!irc_line_includes(line, 2)) return ERR_PROTOCOL; /* nick mode change */ if (irc_line_elem_equals(line, 1, server->nick)) { if (irc_line_includes(line, 3)) mode_args = array_extract(&line->words, 3, -1); log_mode(LINK(server)->log, line->origin, irc_line_elem(line, 1), irc_line_elem(line, 2), mode_args); if (mode_args) array_free(mode_args); irc_user_mode(server, line); return OK_COPY; } // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (!ischannel(irc_line_elem(line, 1)[0])) return ERR_PROTOCOL; #pragma GCC diagnostic pop /* channel mode change */ channel = hash_get(&server->channels, irc_line_elem(line, 1)); /* we can't get mode message for chans we're not on */ if (!channel) return ERR_PROTOCOL; mode_args = NULL; if (irc_line_includes(line, 3)) mode_args = array_extract(&line->words, 3, -1); log_mode(LINK(server)->log, line->origin, irc_line_elem(line, 1), irc_line_elem(line, 2), mode_args); if (mode_args) array_free(mode_args); /* * MODE -a+b.. #channel args * ^ ^ * mode cur_arg */ for (mode = irc_line_elem(line, 2); *mode; mode++) { if (*mode == '-') add = 0; else if (*mode == '+') add = 1; else { int i = 0; char *str = 0; // Check if mode is known: first user modes then // server modes if (!(str = strchr(server->usermodes, *mode))) { array_each(&server->chanmodes, i, str) { if ((str = strchr(str, *mode))) break; } } if (str) { // Usermodes, types A & B always take a // parameter Type C take a parameter only when // set if (i <= 1 || (i == 2 && add)) { if (!irc_line_includes(line, cur_arg + 3)) { return ERR_PROTOCOL; } else { ret = irc_mode_channel( server, channel, line, mode, add, cur_arg); cur_arg++; } } else { ret = irc_mode_channel(server, channel, line, mode, add, cur_arg); } } } if (ret == ERR_PROTOCOL) return ret; } return OK_COPY; } static int irc_mode_channel(struct link_server *s, struct channel *channel, struct line *line, const char *mode, int add, int cur_arg) { const char *nick; long int ovmask; int index; // TODO resolve this issue from array_get // passing argument X of .... with different width due to prototype #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtraditional-conversion" if (*mode == 'k') { if (add) { channel->key = bip_strdup(irc_line_elem(line, cur_arg + 3)); } else { if (channel->key) { free(channel->key); channel->key = NULL; } } } else if ((index = bip_get_index(s->usermodes, *mode))) { nick = irc_line_elem(line, cur_arg + 3); if (!hash_includes(&channel->ovmasks, nick)) return ERR_PROTOCOL; ovmask = (long int)hash_remove(&channel->ovmasks, nick); if (add) ovmask |= 1 << index; else ovmask &= ~(1 << index); hash_insert(&channel->ovmasks, nick, (void *)ovmask); } #pragma GCC diagnostic pop return OK_COPY; } static char *irc_timestamp(void) { char *ts = bip_malloc((size_t)23); snprintf(ts, (size_t)22, "%ld", (long int)time(NULL)); return ts; } static int irc_topic(struct link_server *server, struct line *line) { struct channel *channel; const char *topic; if (irc_line_count(line) != 3) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 1)); /* we can't get topic message for chans we're not on */ if (!channel) return ERR_PROTOCOL; if (channel->topic) free(channel->topic); topic = irc_line_elem(line, 2); if (*topic == ':') topic++; channel->topic = bip_strdup(topic); /* * :arion.oftc.net 333 bip`luser #bipqSDFQE3 * nohar!~nohar@borne28.noc.nerim.net 1107338095 */ if (channel->creator) free(channel->creator); channel->creator = bip_strmaydup(line->origin); if (channel->create_ts) free(channel->create_ts); channel->create_ts = irc_timestamp(); log_topic(LINK(server)->log, line->origin, irc_line_elem(line, 1), topic); return OK_COPY; } static int irc_kick(struct link_server *server, struct line *line) { struct channel *channel; if (irc_line_count(line) != 3 && irc_line_count(line) != 4) return ERR_PROTOCOL; channel = hash_get(&server->channels, irc_line_elem(line, 1)); /* we can't get kick message for chans we're not on */ if (!channel) return ERR_PROTOCOL; if (!hash_includes(&channel->ovmasks, irc_line_elem(line, 2))) return ERR_PROTOCOL; if (strcasecmp(irc_line_elem(line, 2), server->nick) == 0) { /* we get kicked !! */ log_kick(LINK(server)->log, line->origin, channel->name, irc_line_elem(line, 2), irc_line_count(line) == 4 ? irc_line_elem(line, 3) : NULL); log_reset_store(LINK(server)->log, channel->name); log_drop(LINK(server)->log, channel->name); if (LINK(server)->autojoin_on_kick) { if (!channel->key) WRITE_LINE1(CONN(server), NULL, "JOIN", channel->name); else WRITE_LINE2(CONN(server), NULL, "JOIN", channel->name, channel->key); } hash_remove(&server->channels, channel->name); channel_free(channel); return OK_COPY; } hash_remove(&channel->ovmasks, irc_line_elem(line, 2)); log_kick(LINK(server)->log, line->origin, irc_line_elem(line, 1), irc_line_elem(line, 2), irc_line_count(line) == 4 ? irc_line_elem(line, 3) : NULL); return OK_COPY; } static void irc_privmsg_check_ctcp(struct link_server *server, struct line *line) { if (irc_line_count(line) != 3) return; if (!line->origin) return; char *nick; nick = nick_from_ircmask(line->origin); // should not happen if (!nick) return; if (irc_line_elem_equals(line, 2, "\001VERSION\001")) { WRITE_LINE2(CONN(server), NULL, "NOTICE", nick, "\001VERSION bip-" PACKAGE_VERSION "\001"); } free(nick); } static int irc_privmsg(struct link_server *server, struct line *line) { if (!irc_line_includes(line, 2)) return ERR_PROTOCOL; if (LINK(server)->s_state == IRCS_CONNECTED) log_privmsg(LINK(server)->log, line->origin, irc_line_elem(line, 1), irc_line_elem(line, 2)); irc_privmsg_check_ctcp(server, line); return OK_COPY; } static int irc_notice(struct link_server *server, struct line *line) { if (!irc_line_includes(line, 2)) return ERR_PROTOCOL; if (LINK(server)->s_state == IRCS_CONNECTED) log_notice(LINK(server)->log, line->origin, irc_line_elem(line, 1), irc_line_elem(line, 2)); return OK_COPY; } static int irc_quit(struct link_server *server, struct line *line) { return irc_generic_quit(server, line); } static int irc_nick(struct link_server *server, struct line *line) { struct channel *channel; hash_iterator_t hi; char *org_nick; const char *dst_nick; if (irc_line_count(line) != 2) return ERR_PROTOCOL; if (!line->origin) return ERR_PROTOCOL; org_nick = nick_from_ircmask(line->origin); // should not happen if (!org_nick) return ERR_PROTOCOL; dst_nick = irc_line_elem(line, 1); for (hash_it_init(&server->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) { channel = hash_it_item(&hi); if (!hash_includes(&channel->ovmasks, org_nick)) continue; hash_rename_key(&channel->ovmasks, org_nick, dst_nick); log_nick(LINK(server)->log, org_nick, channel->name, dst_nick); } if (origin_is_me(line, server)) { free(server->nick); server->nick = bip_strdup(dst_nick); if (LINK(server)->follow_nick && (LINK(server)->away_nick == NULL || strcmp(server->nick, LINK(server)->away_nick)) != 0) { free(LINK(server)->connect_nick); LINK(server)->connect_nick = bip_strdup(server->nick); } } free(org_nick); return OK_COPY; } static int irc_generic_quit(struct link_server *server, struct line *line) { struct channel *channel; hash_iterator_t hi; char *s_nick; if (irc_line_count(line) != 2 && irc_line_count(line) != 1) return ERR_PROTOCOL; if (!line->origin) return ERR_PROTOCOL; s_nick = nick_from_ircmask(line->origin); // should not happen if (!s_nick) return ERR_PROTOCOL; for (hash_it_init(&server->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) { channel = hash_it_item(&hi); if (!hash_includes(&channel->ovmasks, s_nick)) continue; hash_remove(&channel->ovmasks, s_nick); log_quit(LINK(server)->log, line->origin, channel->name, irc_line_includes(line, 1) ? irc_line_elem(line, 1) : NULL); } free(s_nick); return OK_COPY; } static void ls_set_nick(struct link_server *ircs, char *nick) { if (ircs->nick) free(ircs->nick); ircs->nick = nick; #if 0 if (ircs->ircmask) { char *eom = strchr(ircs->ircmask, '!'); if (!eom) { free(ircs->ircmask); goto fake; } eom = bip_strdup(eom); free(ircs->ircmask); ircs->ircmask = bip_malloc(strlen(nick) + strlen(eom) + 1); strcpy(ircs->ircmask, nick); strcat(ircs->ircmask, eom); free(eom); return; } fake: ircs->ircmask = bip_malloc(strlen(nick) + strlen(BIP_FAKEMASK) + 1); strcpy(ircs->ircmask, nick); strcat(ircs->ircmask, BIP_FAKEMASK); #endif } static char *sasl_mechanism_to_text(int sasl_mechanism) { switch (sasl_mechanism) { case SASL_AUTH_EXTERNAL: return "EXTERNAL"; case SASL_AUTH_PLAIN: return "PLAIN"; default: return "UNKOWN_MECHANISM"; } } // Per RFC send packets of max 400 chars at a time #define SASL_AUTH_CHUNK_SZ 400 static int irc_server_sasl_authenticate(struct link_server *ircs) { char *sasl_username = LINK(ircs)->sasl_username; char *sasl_password = LINK(ircs)->sasl_password; if (LINK(ircs)->sasl_mechanism == SASL_AUTH_EXTERNAL) { WRITE_LINE1(CONN(ircs), NULL, "AUTHENTICATE", "+"); return OK_FORGET; } // Should not happen, but we never know right ? if (!sasl_username || !sasl_password) { mylog(LOG_ERROR, "[%s] Missing SASL username or password.", LINK(ircs)->name); return ERR_AUTH; } /* * Other than EXTERNAL we only support PLAIN. */ size_t chunk_chars = SASL_AUTH_CHUNK_SZ; char chunk[SASL_AUTH_CHUNK_SZ + 1]; size_t u_len = strlen(sasl_username); size_t p_len = strlen(sasl_password); size_t raw_len = u_len * 2 + p_len + 2; size_t enc_len; unsigned char *raw_str = bip_malloc(raw_len + 1); unsigned char *enc_str; memcpy(raw_str, sasl_username, u_len); raw_str[u_len] = '\0'; memcpy(raw_str + u_len + 1, sasl_username, u_len); raw_str[u_len * 2 + 1] = '\0'; memcpy(raw_str + u_len * 2 + 2, sasl_password, p_len); enc_str = base64_encode(raw_str, raw_len, &enc_len); mylog(LOG_DEBUG, "[%s] Base64 encoded SASL auth token (len %d): %s", LINK(ircs)->name, enc_len, enc_str); for (size_t i = 0; i < enc_len; i += chunk_chars) { size_t remaining = enc_len - i; if (remaining < chunk_chars) { memcpy(chunk, &enc_str[i], remaining); chunk[remaining] = '\0'; } else { memcpy(chunk, &enc_str[i], chunk_chars); chunk[chunk_chars] = '\0'; } mylog(LOG_DEBUG, "[%s] SASL AUTHENTICATE chunk %d, len %d: %s", LINK(ircs)->name, i / chunk_chars, strlen(chunk), chunk); WRITE_LINE1(CONN(ircs), NULL, "AUTHENTICATE", chunk); // Send a closing AUTHENTICATE line if last chunk size was // exactly 400 if (remaining == chunk_chars) { mylog(LOG_DEBUG, "[%s] Last SASL chunk was exactly 400, sending +", LINK(ircs)->name); WRITE_LINE1(CONN(ircs), NULL, "AUTHENTICATE", "+"); break; } } free(enc_str); return OK_FORGET; } static void irc_server_startup(struct link_server *ircs) { char *nick; char *username, *realname; /* lower the token number as freenode hates fast login */ CONN(ircs)->token = 1; if (LINK(ircs)->s_password) WRITE_LINE1(CONN(ircs), NULL, "PASS", LINK(ircs)->s_password); username = LINK(ircs)->username; if (!username) username = LINK(ircs)->user->default_username; realname = LINK(ircs)->realname; if (!realname) realname = LINK(ircs)->user->default_realname; WRITE_LINE4(CONN(ircs), NULL, "USER", username, "0", "*", realname); nick = ircs->nick; if (LINK(ircs)->away_nick && LINK(ircs)->l_clientc == 0) { if (nick) free(nick); nick = bip_strdup(LINK(ircs)->away_nick); } if ((!LINK(ircs)->follow_nick && !LINK(ircs)->away_nick) || nick == NULL) { if (nick) free(nick); if (!LINK(ircs)->connect_nick) LINK(ircs)->connect_nick = bip_strdup(LINK(ircs)->user->default_nick); nick = bip_strdup(LINK(ircs)->connect_nick); } ls_set_nick(ircs, nick); WRITE_LINE1(CONN(ircs), NULL, "NICK", ircs->nick); } static void server_next(struct link *l) { l->cur_server++; if (l->cur_server >= l->network->serverc) l->cur_server = 0; } static struct link_client *irc_accept_new(connection_t *conn) { struct link_client *ircc; connection_t *newconn; newconn = accept_new(conn); if (!newconn) return NULL; ircc = bip_calloc(sizeof(struct link_client), (size_t)1); CONN(ircc) = newconn; TYPE(ircc) = IRC_TYPE_LOGGING_CLIENT; CONN(ircc)->user_data = ircc; return ircc; } void server_cleanup(struct link_server *server) { if (server->nick) { free(server->nick); server->nick = NULL; } if (LINK(server)->s_state == IRCS_CONNECTED) { LINK(server)->s_state = IRCS_WAS_CONNECTED; } else { struct line *s; LINK(server)->s_state = IRCS_NONE; while ((s = list_remove_first(&LINK(server)->init_strings))) irc_line_free(s); } hash_iterator_t hi; for (hash_it_init(&server->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) channel_free(hash_it_item(&hi)); hash_clean(&server->channels); if (CONN(server)) { connection_free(CONN(server)); CONN(server) = NULL; } irc_lag_init(server); } void irc_client_close(struct link_client *ic) { if (TYPE(ic) == IRC_TYPE_CLIENT) { struct link_server *is = LINK(ic)->l_server; log_client_disconnected(LINK(ic)->log); unbind_from_link(ic); if (LINK(ic)->l_clientc == 0) { if (is && LINK(ic)->away_nick) WRITE_LINE1(CONN(is), NULL, "NICK", LINK(ic)->away_nick); if (is && LINK(ic)->no_client_away_msg) WRITE_LINE1(CONN(is), NULL, "AWAY", LINK(ic)->no_client_away_msg); log_client_none_connected(LINK(ic)->log); } irc_client_free(ic); } else if (TYPE(ic) == IRC_TYPE_TRUST_CLIENT) { unbind_from_link(ic); irc_client_free(ic); } else if (TYPE(ic) == IRC_TYPE_LOGGING_CLIENT) { irc_client_free(ic); } } static void server_setup_reconnect_timer(struct link *link) { int timer = 0; if (link->last_connection_attempt && time(NULL) - link->last_connection_attempt < CONN_INTERVAL) { timer = conf_reconn_timer * (link->s_conn_attempt); if (timer > RECONN_TIMER_MAX) timer = RECONN_TIMER_MAX; } mylog(LOG_ERROR, "[%s] reconnecting in %d seconds", link->name, timer); link->recon_timer = timer; } static void irc_close(struct link_any *l) { if (CONN(l)) { connection_free(CONN(l)); CONN(l) = NULL; } if (TYPE(l) == IRC_TYPE_SERVER) { /* TODO: free link_server as a whole */ struct link_server *is = (struct link_server *)l; if (LINK(is)->s_state == IRCS_CONNECTED) irc_notify_disconnection(is); irc_server_shutdown(is); log_disconnected(LINK(is)->log); server_next(LINK(is)); server_cleanup(is); server_setup_reconnect_timer(LINK(is)); LINK(is)->l_server = NULL; irc_server_free((struct link_server *)is); } else { irc_client_close((struct link_client *)l); } } struct link_client *irc_client_new(void) { struct link_client *c; c = bip_calloc(sizeof(struct link_client), (size_t)1); list_init(&c->who_queue, list_ptr_cmp); return c; } struct link_server *irc_server_new(struct link *link, connection_t *conn) { struct link_server *s; s = bip_calloc(sizeof(struct link_server), (size_t)1); TYPE(s) = IRC_TYPE_SERVER; hash_init(&s->channels, HASH_NOCASE); link->l_server = s; LINK(s) = link; CONN(s) = conn; irc_lag_init(s); array_init(&s->chanmodes); s->prefixes = NULL; s->usermodes = NULL; server_init_modes(s); return s; } static void server_init_modes(struct link_server *s) { // Default values used if CHANMODES is not specified by the server array_push(&s->chanmodes, bip_strdup("beHIq")); array_push(&s->chanmodes, bip_strdup("k")); array_push(&s->chanmodes, bip_strdup("fjl")); array_push(&s->chanmodes, bip_strdup("fjl")); // Default values used if prefix is not specified by the server s->prefixes = bip_realloc(s->prefixes, sizeof(*s->prefixes) * 3); s->usermodes = bip_realloc(s->usermodes, sizeof(s->usermodes) * 3); strcpy(s->prefixes, "@+"); strcpy(s->usermodes, "ov"); } void irc_server_free(struct link_server *s) { if (CONN(s)) connection_free(CONN(s)); if (s->nick) free(s->nick); if (s->user_mode) free(s->user_mode); int i; char *ptr; array_each(&s->chanmodes, i, ptr) free(ptr); MAYFREE(s->prefixes); MAYFREE(s->usermodes); hash_iterator_t hi; for (hash_it_init(&s->channels, &hi); hash_it_item(&hi); hash_it_next(&hi)) { struct channel *chan = hash_it_item(&hi); channel_free(chan); } hash_clean(&s->channels); free(s); } connection_t *irc_server_connect(struct link *link) { struct link_server *ls; connection_t *conn; link->s_conn_attempt++; mylog(LOG_INFO, "[%s] Connecting user '%s' using server " "%s:%d", link->name, link->user->name, link->network->serverv[link->cur_server].host, link->network->serverv[link->cur_server].port); conn = connection_new(link->network->serverv[link->cur_server].host, link->network->serverv[link->cur_server].port, link->vhost, link->bind_port, #ifdef HAVE_LIBSSL link->network->ssl, link->network->ciphers, link->ssl_check_mode, link->user->ssl_check_store, link->user->ssl_client_certfile, #else 0, NULL, 0, NULL, NULL, #endif (time_t)CONNECT_TIMEOUT); assert(conn); if (conn->handle == -1) { mylog(LOG_INFO, "[%s] Cannot connect.", link->name); connection_free(conn); server_next(link); return NULL; } ls = irc_server_new(link, conn); conn->user_data = ls; list_add_last(&_bip->conn_list, conn); oidentd_dump(_bip); if (link->sasl_mechanism) { mylog(LOG_INFO, "[%s] SASL (%s) enabled, sending CAP REQ.", link->name, sasl_mechanism_to_text(link->sasl_mechanism)); WRITE_LINE2(conn, NULL, "CAP", "REQ", ":sasl"); } irc_server_startup(ls); return conn; } int irc_server_lag_compute(struct link *l) { struct link_server *server = l->l_server; if (LINK(server)->s_state == IRCS_CONNECTED) { if (server->laginit_ts != -1) { irc_compute_lag(server); if (!irc_lags_out(server)) return 0; return 1; } else { server->lagtest_timeout--; if (server->lagtest_timeout == 0) irc_start_lagtest(server); } } return 0; } void irc_server_shutdown(struct link_server *s) { int i; char *cur; array_each(&s->chanmodes, i, cur) free(cur); array_deinit(&s->chanmodes); server_init_modes(s); if (!s->nick) return; if (LINK(s)->prev_nick) free(LINK(s)->prev_nick); LINK(s)->prev_nick = bip_strdup(s->nick); } #define BIP_OIDENTD_START "## AUTOGENERATED BY BIP. DO NOT EDIT ##\n" #define BIP_OIDENTD_END "## END OF AUTOGENERATED STUFF ##\n" #define BIP_OIDENTD_END_LENGTH strlen(BIP_OIDENTD_END) void oidentd_dump(bip_t *bip) { mylog(LOG_ERROR, "%d %s", bip->write_oidentd, bip->oidentdpath); if (!bip->write_oidentd || bip->oidentdpath == NULL) { return; } list_iterator_t it; FILE *f; char *bipstart = NULL, *bipend = NULL; struct stat stats; char tag_written = 0; if (stat(bip->oidentdpath, &stats) == -1) { if (errno == ENOENT && (f = fopen(bip->oidentdpath, "w+"))) { fchmod(fileno(f), 0644); } else { mylog(LOG_WARN, "Can't open/create %s", bip->oidentdpath); return; } } else { /* strip previously autogenerated content */ char *content; f = fopen(bip->oidentdpath, "r+"); if (!f) { mylog(LOG_WARN, "Can't open/create %s", bip->oidentdpath); return; } // casting to size_t as stat should never return negative size content = (char *)bip_malloc((size_t)(stats.st_size + 1)); // validate that content is of stats.st_size size if (fread(content, (size_t)1, (size_t)stats.st_size, f) != (size_t)stats.st_size) { mylog(LOG_WARN, "Can't read %s fully", bip->oidentdpath); free(content); goto clean_oidentd; } /* Set terminating zero for strstr */ content[stats.st_size] = '\0'; bipstart = strstr(content, BIP_OIDENTD_START); if (bipstart != NULL) { // We have some config left, rewrite the file completely fseek(f, (long)SEEK_SET, (int)0); if (ftruncate(fileno(f), (off_t)0) == -1) { mylog(LOG_DEBUG, "Can't reset %s size", bip->oidentdpath); free(content); goto clean_oidentd; } // data preceeding the tag, bipstart >= content (strstr) fwrite(content, (size_t)1, (size_t)(bipstart - content), f); bipend = strstr(bipstart, BIP_OIDENTD_END); if (bipend == NULL) { mylog(LOG_WARN, "No %s mark found in %s", BIP_OIDENTD_END, bip->oidentdpath); } else { /* data following the tag * ...........BIP_OIDENTD_START...BIP_OIDENTD_END.............. * ^content...^bipstart...........^bipend........^remaining * data */ char *remaining = bipend + BIP_OIDENTD_END_LENGTH; off_t remaining_len = stats.st_size - (bipend - content) - (off_t)BIP_OIDENTD_END_LENGTH; if (remaining_len < 0) { mylog(LOG_ERROR, "oidentd_dump: error parsing %s", bip->oidentdpath); goto clean_oidentd; } fwrite(remaining, (size_t)1, (size_t)remaining_len, f); } } else { /* No previous conf */ if (stats.st_size != 0 && content[stats.st_size - 1] != '\n') fprintf(f, "\n"); } free(content); } for (list_it_init(&bip->conn_list, &it); list_it_item(&it); list_it_next(&it)) { connection_t *c = list_it_item(&it); struct link_any *la = c->user_data; if (la && TYPE(la) == IRC_TYPE_SERVER && (c->connected == CONN_OK || c->connected == CONN_NEED_SSLIZE || c->connected == CONN_UNTRUSTED)) { struct link_server *ls; struct link *l; if (!tag_written) { fprintf(f, BIP_OIDENTD_START); tag_written = 1; } ls = (struct link_server *)la; l = LINK(ls); fprintf(f, "to %s fport %d from %s lport %d {\n", c->remoteip, c->remoteport, c->localip, c->localport); fprintf(f, "\treply \"%s\"\n", l->username); fprintf(f, "}\n"); } } if (tag_written) fprintf(f, BIP_OIDENTD_END); clean_oidentd: fclose(f); } void timeout_clean_who_counts(list_t *conns) { list_iterator_t it; for (list_it_init(conns, &it); list_it_item(&it); list_it_next(&it)) { struct link *l = list_it_item(&it); struct link_client *client = l->who_client; if (client && client->whoc_tstamp) { time_t now; now = time(NULL); if (now - client->whoc_tstamp > 10) { mylog(LOG_DEBUG, "Yawn, " "forgetting one who reply"); if (client->who_count > 0) --client->who_count; client->whoc_tstamp = time(NULL); if (client->who_count == 0) rotate_who_client(l); } } } } void bip_init(bip_t *bip) { memset(bip, 0, sizeof(bip_t)); list_init(&bip->link_list, list_ptr_cmp); list_init(&bip->conn_list, list_ptr_cmp); list_init(&bip->connecting_client_list, list_ptr_cmp); hash_init(&bip->users, HASH_NOCASE); hash_init(&bip->networks, HASH_NOCASE); } /* Called each second. */ void bip_tick(bip_t *bip) { static int logflush_timer = 0; struct link *link; list_iterator_t li; /* log flushs */ if (logflush_timer-- <= 0) { logflush_timer = conf_log_sync_interval; log_flush_all(); } /* handle tick for links: detect lags or start a reconnection */ for (list_it_init(&bip->link_list, &li); (link = list_it_item(&li)); list_it_next(&li)) { if (link->l_server) { if (irc_server_lag_compute(link)) { log_ping_timeout(link->log); list_remove(&bip->conn_list, CONN(link->l_server)); irc_close((struct link_any *)link->l_server); } } else { if (link->recon_timer == 0) { connection_t *conn; link->last_connection_attempt = time(NULL); conn = irc_server_connect(link); if (!conn) server_setup_reconnect_timer(link); } else { link->recon_timer--; } } } /* drop lagging connecting client */ for (list_it_init(&bip->connecting_client_list, &li); list_it_item(&li); list_it_next(&li)) { struct link_client *ic = list_it_item(&li); ic->logging_timer++; if (ic->logging_timer > LOGGING_TIMEOUT) { if (CONN(ic)) list_remove(&bip->conn_list, CONN(ic)); irc_close((struct link_any *)ic); list_it_remove(&li); } } /* * Cleanup lagging or dangling who_count buffers */ timeout_clean_who_counts(&bip->link_list); } void bip_on_event(bip_t *bip, connection_t *conn) { struct link_any *lc = (struct link_any *)conn->user_data; if (conn == bip->listener) { struct link_client *n = irc_accept_new(conn); if (n) { list_add_last(&bip->conn_list, CONN(n)); list_add_last(&bip->connecting_client_list, n); } return; } /* reached only if socket is not listening */ int err; list_t *linel = read_lines(conn, &err); if (err) { if (TYPE(lc) == IRC_TYPE_SERVER) { mylog(LOG_ERROR, "[%s] read_lines error, closing...", link_name(lc)); irc_server_shutdown(LINK(lc)->l_server); } else { mylog(LOG_ERROR, "client read_lines error, closing..."); } goto prot_err; } if (!linel) return; char *line_s; while ((line_s = list_remove_first(linel))) { struct line *line; mylog(LOG_DEBUG, "\"%s\"", line_s); if (*line_s == 0) { /* irssi does that.*/ free(line_s); continue; } line = irc_line_new_from_string(line_s); if (!line) { mylog(LOG_ERROR, "[%s] Can not parse line. Link type: %d. " "closing...", link_name(lc), TYPE(lc)); free(line_s); goto prot_err_lines; } int r; r = irc_dispatch(bip, lc, line); irc_line_free(line); free(line_s); if (r == ERR_PROTOCOL) { mylog(LOG_ERROR, "[%s] Error in protocol. Link type: %d closing...", link_name(lc), TYPE(lc)); goto prot_err_lines; } if (r == ERR_AUTH) goto prot_err_lines; /* XXX: not real error */ if (r == OK_CLOSE) goto prot_err_lines; } list_free(linel); return; prot_err_lines: while ((line_s = list_remove_first(linel))) free(line_s); prot_err: list_remove(&bip->conn_list, conn); if (linel) list_free(linel); if (lc) { if (TYPE(lc) == IRC_TYPE_LOGGING_CLIENT || TYPE(lc) == IRC_TYPE_TRUST_CLIENT) list_remove(&bip->connecting_client_list, lc); irc_close(lc); } } /* * The main loop * inc is the incoming connection, clientl list a list of client struct that * represent the accepcted credentials */ void irc_main(bip_t *bip) { time_t timeleft = 1000; if (bip->reloading_client) { char *l; while ((l = list_remove_first(&bip->errors))) bip_notify(bip->reloading_client, "%s", l); bip->reloading_client = NULL; } /* * If the list is empty, we are starting. Otherwise we are reloading, * and conn_list is kept accross reloads. */ if (list_is_empty(&bip->conn_list)) list_add_first(&bip->conn_list, bip->listener); while (!sighup) { connection_t *conn; if (timeleft == 0) { /* * Compute timeouts for next reconnections and lagouts */ timeleft = 1000; bip_tick(bip); } int nc; /* Da main loop */ list_t *ready = wait_event(&bip->conn_list, &timeleft, &nc); if (nc) oidentd_dump(bip); while ((conn = list_remove_first(ready))) bip_on_event(bip, conn); list_free(ready); } while (list_remove_first(&bip->connecting_client_list)) ; return; } void irc_client_free(struct link_client *cli) { if (CONN(cli)) connection_free(CONN(cli)); if (cli->init_pass) free(cli->init_pass); if (cli->init_nick) free(cli->init_nick); free(cli); } struct link *irc_link_new(void) { struct link *link; link = bip_calloc(sizeof(struct link), (size_t)1); link->l_server = NULL; hash_init(&link->chan_infos, HASH_NOCASE); list_init(&link->chan_infos_order, list_ptr_cmp); list_init(&link->on_connect_send, list_ptr_cmp); link->autojoin_on_kick = 1; link->ignore_server_capab = 1; return link; } void link_kill(bip_t *bip, struct link *link) { /* in case in never got connected */ if (link->l_server) { list_remove(&bip->conn_list, CONN(link->l_server)); server_cleanup(link->l_server); irc_server_free(link->l_server); } while (link->l_clientc) { struct link_client *lc = link->l_clientv[0]; if (lc == bip->reloading_client) bip->reloading_client = NULL; list_remove(&bip->conn_list, CONN(lc)); unbind_from_link(lc); irc_client_free(lc); } hash_remove(&link->user->connections, link->name); free(link->name); log_free(link->log); MAYFREE(link->prev_nick); MAYFREE(link->cli_nick); void *p; while ((p = list_remove_first(&link->init_strings))) free(p); while ((p = list_remove_first(&link->on_connect_send))) free(p); MAYFREE(link->no_client_away_msg); MAYFREE(link->away_nick); hash_clean(&link->chan_infos); struct chan_infos *ci; while ((ci = list_remove_first(&link->chan_infos_order))) free(ci); list_remove(&bip->link_list, link); MAYFREE(link->username); MAYFREE(link->realname); MAYFREE(link->s_password); MAYFREE(link->sasl_username); MAYFREE(link->sasl_password); MAYFREE(link->connect_nick); MAYFREE(link->vhost); #ifdef HAVE_LIBSSL sk_X509_free(link->untrusted_certs); #endif free(link); } static void server_set_chanmodes(struct link_server *l, const char *modes) { int i; char *cur; char *dup; mylog(LOG_DEBUG, "[%s] Set chanmodes", LINK(l)->name); array_each(&l->chanmodes, i, cur) free(cur); array_deinit(&l->chanmodes); // handle four categories, ignore all others for (i = 0; i < 4; i++) { cur = strchr(modes, ','); if (cur || modes) { size_t len; if (cur) // cur can't be lower than modes if !NULL len = (size_t)(cur - modes); else len = strlen(modes); // last piece dup = bip_malloc(len + 1); memcpy(dup, modes, len); dup[len] = 0; modes = cur + 1; } else { // emptry string dup = bip_calloc((size_t)1, sizeof(char)); } mylog(LOG_DEBUGVERB, "[%s] Modes: '%s'", LINK(l)->name, dup); array_push(&l->chanmodes, dup); } } static void server_set_prefix(struct link_server *s, const char *modes) { char *end_mode; size_t len; mylog(LOG_DEBUG, "[%s] Set user modes", LINK(s)->name); // PREFIX=(mode)prefix end_mode = strchr(modes + 1, ')'); // skip '(' if (*modes != '(' || !end_mode) { mylog(LOG_WARN, "[%s] Unable to parse PREFIX parameter", LINK(s)->name); return; } // end_mode can't be lower than (modes + 1) len = (size_t)(end_mode - modes - 1); // len of mode without '(' if (len * 2 + 2 != strlen(modes)) { mylog(LOG_WARN, "[%s] Unable to parse PREFIX parameter", LINK(s)->name); return; } s->prefixes = bip_realloc(s->prefixes, sizeof(*s->prefixes) * (len + 1)); s->usermodes = bip_realloc(s->usermodes, sizeof(s->usermodes) * (len + 1)); memcpy(s->usermodes, modes + 1, len); s->usermodes[len] = 0; memcpy(s->prefixes, end_mode + 1, len); s->prefixes[len] = 0; mylog(LOG_DEBUGVERB, "[%s] user prefix: '%s'", LINK(s)->name, s->prefixes); mylog(LOG_DEBUGVERB, "[%s] user modes: '%s'", LINK(s)->name, s->usermodes); } // Return the position (*1 based*) of car in str, else -1 static int bip_get_index(const char *str, char car) { char *cur; long diff; if (!(cur = strchr(str, car))) return 0; diff = cur - str + 1; if (diff > INT_MAX) fatal("bip_get_index: string too long"); return (int)diff; } static int bip_fls(long v) { int r = 0; while (v >>= 1) r++; return r; } bip-0.9.3/src/irc.h0000664000175000017500000001277214212375475010760 00000000000000/* * $Id: irc.h,v 1.43 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004,2005 Arnaud Cornet * Copyright (C) 2004,2005,2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef IRC_H #define IRC_H #include "connection.h" #include "line.h" #include "log.h" #define ERR_PROTOCOL (-1) #define ERR_AUTH (-2) #define OK_COPY (1) #define OK_FORGET (2) #define OK_CLOSE (3) #define OK_COPY_CLI (4) #define OK_COPY_WHO (5) #define P_SERV "b.i.p" #define S_PING "BIPPING" #define P_IRCMASK "-bip!bip@" P_SERV struct server { char *host; unsigned short port; }; #define server_new() bip_calloc(sizeof(struct server), 1) struct channel { char *name; char *mode; char *key; char *topic; int limit; char type; char *creator; char *create_ts; hash_t ovmasks; int running_names; }; #define IRC_TYPE_CLIENT (0) #define IRC_TYPE_SERVER (1) #define IRC_TYPE_LOGGING_CLIENT (2) #define IRC_TYPE_TRUST_CLIENT (3) enum BLTimestamp { BLTSNone = 0, BLTSTime, BLTSDateTime, }; struct bipuser { /** client connection static data **/ char *name; unsigned char *password; unsigned int seed; int admin; int bip_use_notice; /* common link options */ char *default_nick; char *default_username; char *default_realname; /* backlog options */ char backlog; int backlog_lines; char always_backlog; char bl_msg_only; char blreset_on_talk; char blreset_connection; enum BLTimestamp backlog_timestamp; #ifdef HAVE_LIBSSL int ssl_check_mode; char *ssl_check_store; char *ssl_client_certfile; #endif hash_t connections; char in_use; /* for mark and sweep on reload */ }; struct network { char *name; #ifdef HAVE_LIBSSL int ssl; char *ciphers; #endif int serverc; struct server *serverv; }; #define SASL_AUTH_EXTERNAL 1 #define SASL_AUTH_PLAIN 2 struct link { char *name; /* id */ /** link live data **/ struct link_server *l_server; unsigned int l_clientc; struct link_client **l_clientv; struct log *log; /* we honnor the /who from clients one client at a time, this is the * client that is /who-ing. Now for bans too */ struct link_client *who_client; /* server related live stuff */ int s_state; int s_conn_attempt; char *prev_nick; /* XXX del me */ char *cli_nick; list_t init_strings; /* connection state (reconnecting, was_connected ...) */ int recon_timer; time_t last_connection_attempt; /** link options */ char follow_nick; char ignore_first_nick; char autojoin_on_kick; char ignore_server_capab; list_t on_connect_send; char *no_client_away_msg; char *away_nick; hash_t chan_infos; /* channels we want */ list_t chan_infos_order; /* for order only */ struct bipuser *user; /** server connection static data **/ /* server list */ struct network *network; int cur_server; char *username; char *realname; char *s_password; char *sasl_username; char *sasl_password; int sasl_mechanism; char *connect_nick; /* socket creation info */ char *vhost; int bind_port; #ifdef HAVE_LIBSSL int ssl_check_mode; STACK_OF(X509) * untrusted_certs; #endif int in_use; /* for mark and sweep on reload */ }; struct link_connection { int type; connection_t *conn; struct link *link; }; struct link_any { struct link_connection _link_c; }; #define LINK(s) ((s)->_link_c.link) #define CONN(s) ((s)->_link_c.conn) #define TYPE(s) ((s)->_link_c.type) #define IRCC_NONE (0) #define IRCC_NICK (1) #define IRCC_USER (1 << 1) #define IRCC_PASS (1 << 2) #define IRCC_READY (IRCC_NICK | IRCC_PASS | IRCC_USER) struct link_client { struct link_connection _link_c; char *init_nick; char *init_pass; int state; int logging_timer; list_t who_queue; int who_count; time_t whoc_tstamp; #ifdef HAVE_LIBSSL int allow_trust; #endif }; #define IRCS_NONE (0) #define IRCS_CONNECTING (1) #define IRCS_CONNECTED (2) #define IRCS_WAS_CONNECTED (3) #define IRCS_RECONNECTING (4) #define IRCS_TIMER_WAIT (5) struct log; struct chan_info { char *name; char *key; int backlog; }; #define chan_info_new() bip_calloc(sizeof(struct chan_info), (size_t)1) struct link_server { struct link_connection _link_c; char *nick; /* channels we are in */ hash_t channels; char *user_mode; size_t user_mode_len; /* init stuff */ unsigned lag; time_t laginit_ts; int lagtest_timeout; /* chanmodes */ array_t chanmodes; /* user modes */ char *prefixes; char *usermodes; }; typedef struct bip { connection_t *listener; /* all connected tcp connections */ list_t conn_list; /* all links */ list_t link_list; /* connecting clients */ list_t connecting_client_list; hash_t networks; hash_t users; list_t errors; struct link_client *reloading_client; char *oidentdpath; int write_oidentd; } bip_t; void bip_init(bip_t *bip); struct link_client *irc_client_new(void); struct link_server *irc_server_new(struct link *link, connection_t *conn); void irc_server_free(struct link_server *is); struct client *client_new(void); void irc_main(bip_t *); void irc_client_close(struct link_client *); void irc_client_free(struct link_client *); struct link *irc_link_new(void); void link_kill(bip_t *bip, struct link *); void unbind_from_link(struct link_client *ic); char *nick_from_ircmask(const char *mask); void irc_cli_backlog(struct link_client *ic, int hours); #define BIP_FAKEMASK "!bip@bip.bip.bip" #endif bip-0.9.3/src/defaults.h0000664000175000017500000000200614130013041011750 00000000000000/* * $Id: irc.h,v 1.43 2005/04/21 06:58:50 nohar Exp $ * * This file is part of the bip project * Copyright (C) 2004 2005 Arnaud Cornet and Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef DEFAULTS_H #define DEFAULTS_H #include "irc.h" #define DEFAULT_BACKLOG 1 #define DEFAULT_ALWAYS_BACKLOG 0 #define DEFAULT_BL_MSG_ONLY 0 #define DEFAULT_BACKLOG_LINES 10 #define DEFAULT_BACKLOG_TIMESTAMP BLTSTime #define DEFAULT_BLRESET_ON_TALK 0 #define DEFAULT_BLRESET_CONNECTION 0 #define DEFAULT_LOG 1 #define DEFAULT_LOG_SYSTEM 1 #define DEFAULT_LOG_SYNC_INTERVAL 5 #define DEFAULT_LOG_LEVEL LOG_INFO #define DEFAULT_LOG_FORMAT "%u/%n/%Y-%m/%c.%d.log" #define DEFAULT_BIP_USE_NOTICE 0 #define DEFAULT_RECONN_TIMER 120 #endif /* DEFAULTS_H */ bip-0.9.3/src/path_util.h0000664000175000017500000000131113372674606012163 00000000000000/* * This file is part of the bip project * Copyright (C) 2016 Pierre-Louis Bonicoli * * 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. * See the file "COPYING" for the exact licensing terms. */ #ifndef PATH_UTIL_H #define PATH_UTIL_H #include #include /* return path of filename located in bip home directory */ char *default_path(const char *biphome, const char *filename, const char *desc); /* exit program if path doesn't exist */ void assert_path_exists(char *path); #endif bip-0.9.3/src/path_util.c0000664000175000017500000000200613372674606012160 00000000000000/* * This file is part of the bip project * Copyright (C) 2016 Pierre-Louis Bonicoli * * 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. * See the file "COPYING" for the exact licensing terms. */ #include "path_util.h" #include "util.h" #include #include char *default_path(const char *biphome, const char *filename, const char *desc) { char *conf_file; // '/' and \0 conf_file = bip_malloc(strlen(biphome) + strlen(filename) + 2); strcpy(conf_file, biphome); conf_file[strlen(biphome)] = '/'; conf_file[strlen(biphome) + 1] = '\0'; strcat(conf_file, filename); mylog(LOG_INFO, "Default %s: %s", desc, conf_file); return conf_file; } void assert_path_exists(char *path) { struct stat st_buf; if (stat(path, &st_buf) != 0) fatal("Path %s doesn't exist (%s)", path, strerror(errno)); } bip-0.9.3/src/conf.y0000664000175000017500000002351214212375367011143 00000000000000%{ /* * $Id: conf.y,v 1.26 2005/04/17 15:20:32 nohar Exp $ * * This file is part of the bip proproject * Copyright (C) 2004 Arnaud Cornet * Copyright (C) 2022 Loïc Gomez * * 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. * See the file "COPYING" for the exact licensing terms. */ #include #include "util.h" #include "irc.h" #include "tuple.h" extern int yylex (void); extern char *yytext; extern int linec; #define YYMALLOC bip_malloc extern int yyerror(char *); int yywrap(void) { return 1; } //int yydebug = 1; list_t *root_list; struct tuple *tuple_i_new(int type, int i) { struct tuple *t; t = bip_malloc(sizeof(struct tuple)); t->type = type; t->ndata = i; t->tuple_type = TUPLE_INT; return t; } struct tuple *tuple_p_new(int type, void *p) { struct tuple *t; t = bip_malloc(sizeof(struct tuple)); t->type = type; t->pdata = p; return t; } struct tuple *tuple_s_new(int type, void *p) { struct tuple *t = tuple_p_new(type, p); t->tuple_type = TUPLE_STR; return t; } struct tuple *tuple_l_new(int type, void *p) { struct tuple *t = tuple_p_new(type, p); t->tuple_type = TUPLE_LIST; return t; } %} %token LEX_IP LEX_EQ LEX_PORT LEX_CSS LEX_SEMICOLON LEX_CONNECTION LEX_NETWORK LEX_LBRA LEX_RBRA LEX_USER LEX_NAME LEX_NICK LEX_SERVER LEX_PASSWORD LEX_SRCIP LEX_HOST LEX_VHOST LEX_SOURCE_PORT LEX_NONE LEX_COMMENT LEX_BUNCH LEX_REALNAME LEX_SSL LEX_SSL_CHECK_MODE LEX_SSL_CHECK_STORE LEX_SSL_CLIENT_CERTFILE LEX_CIPHERS LEX_CSS_CIPHERS LEX_DEFAULT_CIPHERS LEX_DH_PARAM LEX_CHANNEL LEX_KEY LEX_LOG_ROOT LEX_LOG_FORMAT LEX_LOG_LEVEL LEX_BACKLOG_LINES LEX_BACKLOG_TIMESTAMP LEX_BACKLOG_NO_TIMESTAMP LEX_BACKLOG LEX_LOG LEX_LOG_SYSTEM LEX_LOG_SYNC_INTERVAL LEX_FOLLOW_NICK LEX_ON_CONNECT_SEND LEX_AWAY_NICK LEX_PID_FILE LEX_WRITE_OIDENTD LEX_OIDENTD_FILE LEX_IGN_FIRST_NICK LEX_ALWAYS_BACKLOG LEX_BLRESET_ON_TALK LEX_BLRESET_CONNECTION LEX_DEFAULT_USER LEX_DEFAULT_NICK LEX_DEFAULT_REALNAME LEX_NO_CLIENT_AWAY_MSG LEX_BL_MSG_ONLY LEX_ADMIN LEX_BIP_USE_NOTICE LEX_CSS_PEM LEX_AUTOJOIN_ON_KICK LEX_IGNORE_CAPAB LEX_RECONN_TIMER LEX_SASL_USERNAME LEX_SASL_PASSWORD LEX_SASL_MECHANISM %union { int number; char *string; void *list; struct tuple *tuple; } %token LEX_BOOL LEX_INT %token LEX_STRING %type commands server network channel user connection %type command ser_command net_command cha_command usr_command con_command %% commands: { $$ = root_list = list_new(NULL); } | commands command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } ; command: LEX_LOG_ROOT LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_LOG_ROOT, $3); } | LEX_LOG_FORMAT LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_LOG_FORMAT, $3); } | LEX_LOG_LEVEL LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_LOG_LEVEL, $3); } | LEX_RECONN_TIMER LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_RECONN_TIMER, $3); } | LEX_IP LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_IP, $3); } | LEX_PORT LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_PORT, $3); } | LEX_CSS LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_CSS, $3); } | LEX_CSS_PEM LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_CSS_PEM, $3); } | LEX_CSS_CIPHERS LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_CSS_CIPHERS, $3); } | LEX_DEFAULT_CIPHERS LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_DEFAULT_CIPHERS, $3); } | LEX_DH_PARAM LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_DH_PARAM, $3); } | LEX_LOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_LOG, $3); } | LEX_LOG_SYSTEM LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_LOG_SYSTEM, $3); } | LEX_LOG_SYNC_INTERVAL LEX_EQ LEX_INT { $$ = tuple_i_new( LEX_LOG_SYNC_INTERVAL, $3); } | LEX_PID_FILE LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_PID_FILE, $3); } | LEX_WRITE_OIDENTD LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_WRITE_OIDENTD, $3); } | LEX_OIDENTD_FILE LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_OIDENTD_FILE, $3); } /* deprecated */ | LEX_BACKLOG_LINES LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_BACKLOG_LINES, $3); } | LEX_BACKLOG_TIMESTAMP LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_BACKLOG_TIMESTAMP, $3); } | LEX_BACKLOG_NO_TIMESTAMP LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, $3); } | LEX_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG, $3); } | LEX_BLRESET_ON_TALK LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BLRESET_ON_TALK, $3); } | LEX_BL_MSG_ONLY LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BL_MSG_ONLY, $3); } | LEX_ALWAYS_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new( LEX_ALWAYS_BACKLOG, $3); } /* /deprecated */ | LEX_NETWORK LEX_LBRA network LEX_RBRA { $$ = tuple_l_new(LEX_NETWORK, $3); } | LEX_USER LEX_LBRA user LEX_RBRA { $$ = tuple_l_new(LEX_USER, $3); } network: { $$ = list_new(NULL); } | network net_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } net_command: LEX_NAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NAME, $3); } | LEX_SSL LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_SSL, $3); } | LEX_CIPHERS LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_CIPHERS, $3); } | LEX_SERVER LEX_LBRA server LEX_RBRA { $$ = tuple_l_new(LEX_SERVER, $3); } user: { $$ = list_new(NULL); } | user usr_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } usr_command: LEX_NAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NAME, $3); } | LEX_PASSWORD LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_PASSWORD, $3); } | LEX_ADMIN LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_ADMIN, $3); } | LEX_BIP_USE_NOTICE LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BIP_USE_NOTICE, $3); } | LEX_SSL_CHECK_MODE LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SSL_CHECK_MODE, $3); } | LEX_SSL_CHECK_STORE LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SSL_CHECK_STORE, $3); } | LEX_SSL_CLIENT_CERTFILE LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SSL_CLIENT_CERTFILE, $3); } | LEX_DEFAULT_USER LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_DEFAULT_USER, $3); } | LEX_DEFAULT_NICK LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_DEFAULT_NICK, $3); } | LEX_DEFAULT_REALNAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_DEFAULT_REALNAME, $3); } | LEX_BACKLOG_LINES LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_BACKLOG_LINES, $3); } | LEX_BACKLOG_TIMESTAMP LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_BACKLOG_TIMESTAMP, $3); } | LEX_BACKLOG_NO_TIMESTAMP LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, $3); } | LEX_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG, $3); } | LEX_BLRESET_ON_TALK LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BLRESET_ON_TALK, $3); } | LEX_BLRESET_CONNECTION LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BLRESET_CONNECTION, $3); } | LEX_BL_MSG_ONLY LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BL_MSG_ONLY, $3); } | LEX_ALWAYS_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new( LEX_ALWAYS_BACKLOG, $3); } | LEX_CONNECTION LEX_LBRA connection LEX_RBRA { $$ = tuple_l_new(LEX_CONNECTION, $3); } connection: { $$ = list_new(NULL); } | connection con_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } con_command: LEX_NAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NAME, $3); } | LEX_NETWORK LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NETWORK, $3); } | LEX_LOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_LOG, $3); } | LEX_NICK LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NICK, $3); } | LEX_USER LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_USER, $3); } | LEX_REALNAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_REALNAME, $3); } | LEX_PASSWORD LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_PASSWORD, $3); } | LEX_SASL_USERNAME LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SASL_USERNAME, $3); } | LEX_SASL_PASSWORD LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SASL_PASSWORD, $3); } | LEX_SASL_MECHANISM LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SASL_MECHANISM, $3); } | LEX_VHOST LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_VHOST, $3); } | LEX_SOURCE_PORT LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_SOURCE_PORT, $3); } | LEX_AWAY_NICK LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_AWAY_NICK, $3); } | LEX_FOLLOW_NICK LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_FOLLOW_NICK, $3); } | LEX_IGN_FIRST_NICK LEX_EQ LEX_BOOL { $$ = tuple_i_new( LEX_IGN_FIRST_NICK, $3); } | LEX_AUTOJOIN_ON_KICK LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_AUTOJOIN_ON_KICK, $3); } | LEX_IGNORE_CAPAB LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_IGNORE_CAPAB, $3); } | LEX_CHANNEL LEX_LBRA channel LEX_RBRA { $$ = tuple_l_new( LEX_CHANNEL, $3); } | LEX_ON_CONNECT_SEND LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_ON_CONNECT_SEND, $3); } | LEX_NO_CLIENT_AWAY_MSG LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_NO_CLIENT_AWAY_MSG, $3); } | LEX_SSL_CHECK_MODE LEX_EQ LEX_STRING { $$ = tuple_s_new( LEX_SSL_CHECK_MODE, $3); } channel: { $$ = list_new(NULL); } | channel cha_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } cha_command: LEX_NAME LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_NAME, $3); } | LEX_KEY LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_KEY, $3); } | LEX_BACKLOG LEX_EQ LEX_BOOL { $$ = tuple_i_new(LEX_BACKLOG, $3); } server: { $$ = list_new(NULL); } | server ser_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; } ser_command: LEX_HOST LEX_EQ LEX_STRING { $$ = tuple_s_new(LEX_HOST, $3); } | LEX_PORT LEX_EQ LEX_INT { $$ = tuple_i_new(LEX_PORT, $3); } bip-0.9.3/INSTALL0000664000175000017500000003660513660366312010271 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. 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 warranty of any kind. Basic Installation ================== Briefly, the shell commands './configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. bip-0.9.3/compile0000754000175000017500000001635014212410717010577 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bip-0.9.3/README0000664000175000017500000002070513403706252010106 00000000000000This is the BIP IRC Proxy README. Bip can be used in two different ways: - Old school bnc user style: easy and straightforward. - Unix service style with and init.d scripts and the logs in /var/log This small README file explains the usage "Old school" with which : - you do not need the root privileges. - gives easy access to the logs to the owner of the shell. Table of contents : I. Installation II. Configuration A. Manual configuration B. Automated configuration III. Running bip IV. Using bip A. Connecting your client(s) B. Backlog and flood control C. Multiple users and ident issues I. INSTALLATION Install bip on the machine that will be running bip (which is likely to be your personnal or shared server) either compiling the package or using your distro's package. Then create a configuration file. Choose your distribution package if available. If not, build bip the old-fashioned way. You will need make, gcc, lex, yacc, automake, autoconf-archive and optionally libssl-dev to build bip. Just issue: From bip-X.Y.Z.tar.gz package: # ./configure && make From repository: # autoreconf -i # ./configure --enable-maintainer-mode && make If openssl and its developement files are installed, bip should build with SSL support. After a successful build the bip binary can be found in ./src/bip. By default, "-Werror" is used. If you encounter warnings, you could try: # CFLAGS="-Wno-error" ./configure && make II. CONFIGURATION First of all, create your bip configuration an log directory: # mkdir -p ~/.bip/logs There are two ways to create your bip configuration : - edit the sample bip.conf file to match your needs - use the bipgenconfig script to easily generate a configuration If you want to connect to bip using an SSL client, you'll need to create a certificate / key pair (in a bip.pem file) to allow bip to serve SSL sockets. A. MANUAL CONFIGURATION If you are using a distribution package, the bip.conf sample configuration file is likely to be shipped in /usr/share/doc/bip/examples/bip.conf.gz or something similar. If not, you'll find sample configuration file in the source package's `samples' subdirectory. Put the uncompressed configuration file in your ~/.bip directory (its path should be ~/.bip/bip.conf), and edit it, most importantly the "user" section that contains information about you and the servers you will want to connect to. The "name" field in the "user" section is your login to connect to bip. The "name" field of the "connection" subsections are the server identifier for when you connect to bip. The "password" field is a hash of the password you will use to connect to bip. To generate a hash value from a password, use bipmkpw, program which comes in the bip package and source. If you've set client_side_ssl to true, you'll need to generate a bip.pem file containing a certificate / key pair. In order to do so, you can use the third party `openssl' binary : # openssl req -new -x509 -days 365 -nodes -out bip.pem -keyout bip.pem You can then remove the passphrase with : # openssl x509 -subject -dates -fingerprint -noout -in bip.pem B. AUTOMATED CONFIGURATION You can also use the bipgenconfig script to generate a new configuration. This script will also help you generate the SSL certificate / key pair needed for clients to connect to BIP through SSL. This script can be found either in the source package's `scripts' directory or shipped with your distribution's package. Using the script is very simple, and it will generate a configuration file but won't overwrite any existing configuration. It will ask you the path to the bipmkpw binary, to automatically hash the passwords you'll provide. Please make sure to enter the correct path to the binary or you might observe unexpected behaviour. You'll need to move the generated configuration from bip.conf.autogen to bip.conf and the generated PEM file from bip.pem.autogen to bip.pem (or whatever path you've configured in bip.conf). III. RUNNING BIP Once all this is configured, start bip as your regular user: # ./src/bip If you have installed bip in your path (or if you are using you distribution's package), simply use: # bip Once bip starts, it connects to the different servers your defined in all "user"'s "connection" blocks. IV. USING BIP A. CONNECTING YOUR CLIENT(S) Then you want to use your regular irc client and connect to bip. Point your client to the machine bip is running and set the proper port number (defined in your bip.conf). You should then configure the client to use a specific irc server password constructed this way: user:password:connection The user is the name field of the "user" section, the password is the password (*not* the hash) corresponding to the "password" field of the same user section (which is the hash generated with bipmkpw) and the connection is the "name" field of the "connection" subsection. This is how bip authenticates you and puts your client to the correct network. Using the default (or sample file) configuration, logs are in ~/.bip/logs/ B. BACKLOG AND FLOOD CONTROL Bip has a backlogging system which will send back parts of the last logs upon client connection. Depending on your configuration, that may mean a *lot* of data sent back to your client. Users' messages will be replayed as if they were being sent at the moment your client connects to bip, and if not disabled, system messages will appear as coming from the "-bip" user. Considering that, you may want to disable your client's anti-flood system, totally or not, depending on it's flexibility. Since bip doesn't replay CTCP messages, you can safely let your client's anti-flood system manage them. [Xchat] If you're using Xchat, you can "disable" it by issuing these commands : /set flood_msg_num = 1000 /set flood_msg_time = 10 In fact you'll tell xchat to activate its anti-flood system when you're receiving more than 1000 messages in less than 10 seconds. If you forgot to set these, private messages may not appear in separate tabs as usual. If so, simply issue a : /set gui_auto_open_dialog on C. MULTIPLE USERS AND IDENT ISSUES When you host many connections to the same IRC network, you might have more connections than allowed by the network from one host. Depending on the network and the services it runs, session limits may be enforced either matching only your ip address/hostname, or matching the username/ident part too. To avoid being killed for session limit exceeded, you should define a default_username in each user {}; block. A user without default_username would appear as ~bip@yourhost if bip is the system user running bip. With a default_username set to "myuser", he would appear as ~myuser@yourhost, which may be sufficient for most networks. If the network you're on is a bit more demanding, you can set up an oidentd server on your host, and enable oidentd spoofing support ('write_oidentd = true;' option in bip configuration file). Let's say bip is the system user running bip, you should add to your /etc/oidentd.conf : user "bip" { default { allow spoof_all allow spoof_privport allow spoof } } Then reload oidentd and make sure that ~bip is accessible (+rx) by the user running oidentd (which means most of the time ~bip should be world readable and browsable +rx). If you already have a ~bip/.oidentd.conf file, don't worry, bip'll only add its entries without deleting any of the contents of the file. This step should remove the "~" character from the username/ident part of your ircmask, and thus satisfy some networks. If the network is still killing you for session limit exceeded, you'll have to contact it's admins and ask them for an exception on your host or ip address. Happy ircing! -- Arnaud Cornet and Loïc Gomez bip-0.9.3/NEWS0000664000175000017500000001467114212377446007742 000000000000002022-03-10 (0.9.3) "sanitize our bip and add some layers" - Add SASL authentication support (EXTERNAL, PLAIN) - Handle some recommended GCC flags - fix /bip user info command 2021-10-12 (0.9.2) "for the love of unsubsquirrel" - Update and fix minor issues in sample bip and vim configuration files 2021-10-12 (0.9.1) "one more" - ENABLED might not be defined: use a default value. 2021-10-08 (0.9.0) "it's never too late" Visible changes: - "backlog_no_timestamp" is deprecated, "backlog_timestamp" should be used instead. The allowed values for this new parameter are: "none", "time", "datetime". "time" is the default value and allow to keep the default behavior. - allow to set TLS ciphers: for bip client side (client_side_ciphers), globally for all connections (ssl_default_ciphers) and foreach connection (ssl_ciphers). - allow to set DH parameter used for clients SSL connections with the new client_side_dh_param parameter. - Add write_oidentd_file parameter. Existing oidentd users must use 'write_oidentd = true' in their config to keep existing behavior. 2013-10-19 (0.8.9) "If it's really that urgent, why don't you do it yourself?" - code fixes - buildsys fixes (bison 2.6 compatibility and others) - improved TRUST OK command replies when there's no untrusted certificate - fixed GCC warnings 2011-04-14 (0.8.8) "spring release" - Allow to disable logs by connection. - When global option log is disabled, query are not backlogged. - Avoid segfault when global option log is false. 2011-01-18 (0.8.7) "bazooka" - Fix "FATAL: list_remove: item not found" - Fix build errors on armel - minor fixes 2010-09-12 (0.8.6) "CVE-2010-3071" - Fix for CVE-2010-3071. 2010-08-07 (0.8.5) "Unpacking" - Now builds position independant executables 2009-11-15 (0.8.4) "I’ll have the same thing please" - Fix build OpenSSL detection issue. 2009-11-15 (0.8.3) "Hey Dublin! What’s the craic?" - Fixes a fatal() on gamesurge networks. 2009-08-24 (0.8.2) "Farewell Paris" - Fix hanging bip on hanging client connexions. 2009-07-17 (0.8.1) "Ran ran ru in Praha" - Fixed an annoying bug that resulted in too much backlog. - Fix TRUST command. - Close some unused log files. 2009-03-02 (0.8.0) "swelling millionnaire" - Cosmetic bug fixes since last rc. 2009-02-02 (0.8.0-rc1) "got booze?" - One bug fixed and a client hack added to avoid the "+" or "-" prefix in irssi when connecting irssi and xchat to the same bip connection. 2009-01-24 (0.8.x) Visible changes: - One logfile per nick for queries, instead of the messy privates.x.log Slight log format change (now the format of the log of queries is very similar to the on used for channels) - "Window"-local blreset and blreset on talk. By default the blreset_on_talk now only clears the backlog of the query you talked to or the channel you talked to. The /quote bip blreset command now can take a query name or a channel name as an argument. "/quote bip blreset" still resets the backlog of the whole network. - /quote bip backlog x command where x is the number of hours will backlog x hours. - autorejoin on kick by default. Can be disabled with the option autojoin_on_kick = false in a connection block. - bip SSL on the client<->bip part now support Ephemeral Diffie Hellman key exchange. 2008-10-24 (0.7.5) "But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep." - Halfop handling fixed, and a shameful segfault. The segfault may be exploitable by clients, but only after successful login. Please upgrade. 2008-06-28 (0.7.4) "But where is 0.7.3 ?!" - Some usefull bugfixes, especially for unreal irc network users. 2008-04-05 (0.7.2) "Enjoy the fish" - Contains a compilation fix for OpenBSD. 2008-04-02: bip 0.7.1 "hot mama" - Contains a configuration validation fix, and a memory leak fix. 2008-02-16 (0.7.0) "birthday party" - The good stuff: sighup support, /bip reload should also work now - New commands (allow a user to add a new network without restarting bip for instance) - Better user feedback when issuing /bip commands. - Lots of new backlog options, some of which can now be set per user instead of globally. - And a few fixes on top of that. 2008-02-07 Arnaud Cornet What's to expect in bip now: - Support kill -HUP and /bip reload cleanly. - Close/reopen files on sighup. - Have some reply when running BIP commands. ssl_check_mode, always_backlog, backlog, bl_msg_only, backlog_lines, backlog_no_timestamp, blreset_on_talk be settable at the connection block rather than the user block. - Add backlog option to channels. Useful if you don't care about one particular channel. - bip_use_notice: Add this option to receive bip message through notices. - Make SSL "basic" certificate check more loose (more SSH-like). In "basic" mode, normally un trusted certificates get to be trusted if they manually trusted by user. This provides an SSH like private key auth mechani Expired certificates were considered invalid in this mode which does not make much sense. - blreset: add -q option to /bip blreset command if you don't want it to reply anything (for scripts). - Support add_conn and del_conn bip commands for live connection addition and removal. - Have a bold arrow to highligh your own word on private messages and multiple connected clients. 2007-12-09 - Bip has now two types of users "admins" and normal user. Some commands are reserved to admin. Add a admin = true; statement in your config (in user block) accordingly. 2007-10-29 - Certificate validation change. In "basic" mode, expired certificates are now accepted as long as they are in store (therefore trusted). This makes the basic mode be more SSH like. Some extreme security zealots might want to be warned. 2007-09-02 - as of now log parameters go in the user {} statment. This breaks every config and there is no backwrads compatibility as of now. - Lots of internal changes, expect crashes. 2007-08-19 (0.6.1) - Fixes half closed socket descriptor leak, as well as a potential crash on startup. - Bip switches to git. You can clone the public repository with: - git clone http://bip.t1r.net/bip.git 2007-02-27 (0.6.0) - Includes more commands, more options, more fixes. - UPDATE: Thanks to YS for the sexy logo! How rude of me to forget to give proper credits! - Bip is developed by Arnaud Cornet and Loïc Gomez and is distributed under the GNU Public License Version 2 (see the AUTHORS file for a list of contributors). - BIP IRC channel is on OFTC : irc://irc.oftc.net/bip bip-0.9.3/bip.conf.50000664000175000017500000003627014212375327011022 00000000000000.TH BIP.CONF 5 "2 January 2022" .SH NAME bip.conf \- Configuration file for BIP IRC Proxy .SH SYNOPSIS .PP ~/.bip/bip.conf .SH DESCRIPTION A BIP configuration file consists of a list of variable affectations or sections. It contains the global options, networks definitions, users configuration, users connections declarations. Each section is described in this manpage. The .BR bip.conf skeleton should be something like this : .EX option1 = value; option2 = value; ... network { net_opt = value; ... server { ... }; server { ... }; }; ... user { user_opt = value; ... connection { conn_opt = value; ... channel { ... }; }; connection { conn_opt = value; ... channel { ... }; channel { ... }; ... }; }; .EE .SH SYNTAX RULES The syntax is quite simple : .RS .IP \(bu 4 everything after the \fB#\fP character is ignored (comments) .IP \(bu 4 each variable affectation must be finished with a \fB;\fP .IP \(bu 4 each section { } must be finished with a \fB;\fP .RE If you use vim you will probably want to use vim with the provided \fBbip.vim\fP syntax file to avoid common syntax and lexical mistakes. You can also find an example configuration file along with BIP. By default, \fBbipdir\fR is the \fI$HOME/.bip\fR directory and the parent directory for client certificate, configuration, logs, pid, oidentd. If environment variable \fB$HOME\fP doesn't exist, \fB-s\fP parameter must be used. .SH GLOBAL OPTIONS .TP \fBclient_side_ssl\fP (default: \fBfalse\fP) When true, clients will need to connect to BIP using SSL. You'll also need to generate a SSL cert/key pair in \fIbipdir/bip.pem\fR (usually \fI~/.bip/bip.pem\fR or \fI/var/lib/bip/bip.pem\fR) or \fBclient_side_ssl_pem\fP if defined. .TP \fBclient_side_ssl_pem\fP (default: \fI/bip.pem\fR) Set this to the full path of the cert/key pair bip should use to accept clients SSL connections. .TP \fBclient_side_ciphers\fP OpenSSL cipher lists used for clients SSL connections. If not set, OpenSSL default ciphers will be used. .TP \fBclient_side_dh_param\fP DH parameters filename\fP (default: \fI/dh.pem\fR) Used for clients SSL connections, Supply at least 2048-bit parameters. .TP \fBssl_default_ciphers\fP OpenSSL cipher lists used for server connections. If not set, OpenSSL default ciphers will be used. .TP \fBip\fP (default: \fB0.0.0.0\fP) Listening IP address. This is the IP address bip will listen for incoming client connections. .TP \fBlog\fP (default: \fBtrue\fP) When true, the log system is enabled. Else, BIP will not write a single log file. Backlog is then stored into memory. .TP \fBlog_system\fP (default: \fBtrue\fP) When true, system messages such as connection errors are logged. Else, BIP will not write system logs. .TP \fBlog_format\fP (default: \fB%u/%n/%Y-%m/%c.%d.log\fP) Determines the log filename depending on : .br \- %u username (name in \fBuser\fP { }; section) .br \- %n network name (name in \fBconnection\fP { }; section) .br \- %c channel name .br \- %Y 4 digits year .br \- %m 2 digits month .br \- %d 2 digits day .TP \fBlog_level\fP (default: \fB1\fP) Specify the verbosity of BIP from 0 (fatal errors) to 6 (huge debug output) .TP \fBlog_root\fP (default: \fI/logs\fR Main log directory. Sub-directories and files will be created from there depending on \fBlog_format\fP. .TP \fBlog_sync_interval\fP (default: \fB5\fP) Defines the delay between each logfiles sync to the disk. Must be a non null positive integer. .TP \fBreconn_timer\fP (default: \fB120\fP) Defines the initial delay (in seconds) before a reconnection attempt. The delay increases with the number of attempts: delay = reconn_timer * number of attempts .TP \fBpid_file\fP (default: \fI/bip.pid\fR) Defines the file where BIP's pid will be stored. BIP checks if this file exists and if the pid is still alive upon startup. If true, BIP refuses to start. .TP \fBwrite_oidentd\fP (default: \fIfalse\fR) Must be set to true to overwrite oidentd configs. .TP \fBoidentd_file\fP (default: \fI/.oidentd.conf\fR) oidentd configuration file (if oidentd enabled). .TP \fBport\fP (default: \fB7778\fP) The port on which BIP should listen for clients. .SH NETWORK SECTION This section allows you to declare a network for use in the connection sections. It may appear more than once in the configuration file. .TP \fBssl\fP (default: \fBfalse\fP) If true, BIP will connect to this network using SSL only. You cannot mix SSL servers and non-SSL servers in the same \fBnetwork\fP section. This is by choice, we believe it's a bad idea. .TP \fBssl_ciphers\fP (override global \fBssl_default_ciphers\fP) OpenSSL cipher lists used for this network. .TP \fBname\fP It's the network name used in the \fBconnection\fP section. Please note that this value is not used in \fBlog_format\fP, since it uses the variable \fBname\fP from the \fBconnection\fP section. .SH SERVER SUB-SECTION BIP will cycle through the server sections list when reconnecting to a network. It may appear more than once in a network section. .TP \fBhost\fP The server's hostname or IP address. .TP \fBport\fP (default: \fB6667\fP) The server port to connect to. .SH USER SECTION This section allows you to define the users allowed to connect to BIP and their options. It may appear more than once in the configuration file. .TP \fBadmin\fP (default: \fBfalse\fP) If a user has admin set to true, he'll become a bip administrator, which allows him for example to reload bip from IRC or to see the user configuration. .TP \fBbacklog\fP (default: \fBtrue\fP) Enable or disable the whole backlog system, which allows clients to see a log replay upon connection. .TP \fBbacklog_always\fP (default: \fBfalse\fP) If true, clients will always receive \fBbacklog_lines\fP log lines, even if they were already sent before. That means : If \fBbacklog_always\fP is false, backlog will be reset whenever there is no more client connected to a network. Else backlog will not be reset. This option should of course not be enabled if \fBbacklog_lines\fP is 0 ! If you still want to do so, don't forget to \fB/BIP BLRESET\fP sometimes. .TP \fBbacklog_lines\fP (default: \fB10\fP) If set to 0, BIP will replay all the logs since last client disconnect. Else, it'll replay exactly \fBbacklog_lines\fP lines on each channel and privates. Be aware that BIP will replay \fBbacklog_lines\fP lines of all privates, even if there are more. For example if Coyote told you 12 lines and then RoadRunner 6, you'll only have a replay of the 6 RoadRunner's lines and the last 4 of Coyote's. .TP \fBbacklog_timestamp\fP (default: \fBtime\fP) \fBnone\fP disables timestamps in backlogged lines, \fBtime\fP or \fBdatetime\fP allow one to select the timestamp format in backlogged lines. .TP \fBbacklog_no_timestamp\fP (default: \fBfalse\fP) This parameter is deprecated, use \fBbacklog_timestamp\fP instead. .I false implies .I backlog_timestamp = "none" and .I true implies .I backlog_timestamp = "time" \&. .TP \fBbacklog_reset_on_talk\fP (default: \fBfalse\fP) When true, backlog will be reset upon client talk (channel/private message or action). It means that next time you log to your bip session, the backlogging will start at the time right after your last words on that specific channel or query. .TP \fBbacklog_reset_connection\fP (default: \fBfalse\fP) When true, backlog_reset_on_talk option above is changed in that the whole network backlog is reset when you talk in the network. .TP \fBbacklog_msg_only\fP (default: \fBfalse\fP) When true, bip will backlog only channel/private messages/notices. No topic change, nick change, user quit/part/join will be backlogged upon connection. .TP \fBbip_use_notice\fP (default: \fBfalse\fP) If \fBbip_use_notice\fP is true, bip's notifications to the clients will be send as notices instead of private messages. For example, this setting applies to disconnection notifications or \fB/BIP\fP command replies. .TP \fBdefault_nick\fP The default nick option for each \fBconnection\fP section where no \fBnick\fP is defined. See \fBCONNECTION SECTION\fP for more details. .TP \fBdefault_realname\fP The default realname option for each \fBconnection\fP section where no \fBrealname\fP is defined. See \fBCONNECTION SECTION\fP for more details. .TP \fBdefault_user\fP The default user option for each \fBconnection\fP section where no \fBuser\fP is defined. See \fBCONNECTION SECTION\fP for more details. .TP \fBname\fP The username. It'll be used to authenticate to bip and in \fBlog_format\fP. .TP \fBpassword\fP The password. It \fBMUST\fP be generated with \fBbipmkpw\fP or it'll not work. .TP \fBssl_check_mode\fP (default: \fBnone\fP) Tells whether BIP should check the server SSL certificate and against what. Can be \fBnone\fP for no check at all, \fBca\fP to check if the cert is signed by a Certificate Authority in repository, or \fBbasic\fP to check if cert exists in repository. The repository is defined by \fBssl_check_store\fP. This allows a "ssh-like" private key generation scheme. Note that in basic mode: .br - expired certificates that are in the store are considered valid. .br - CA-signed certificates are considered valid even if not in store. .TP \fBssl_check_store\fP (default: \fBnot set\fP) This repository is browsed by BIP when a SSL certificate or CA check is needed. In ssl_check_mode \fBbasic\fP it must be a file, to which certificates you choose to trust will be appended. In ssl_check_mode \fBca\fP it may be a single file containing one or more trusted certificates concatenated together between BEGIN CERTIFICATE and END CERTIFICATE lines, a directory containing individual certificates in PEM format which has been processed by \fBc_rehash\fP, or unset, in which case bip will attempt to use the default certificate store of the OpenSSL it is built against. .TP \fBssl_client_certfile\fP (default: \fBnot set\fP) Some networks (OFTC at least) allow you to authenticate to nickserv services using a client side certificate. Make this variable point to the .pem file to use this feature. .SH CONNECTION SUB-SECTION Each \fBconnection\fP section associates a user to the networks he wants to connect to. Thus, it must be declared in the \fBUser\fP sections, and can be used more than once. .TP \fBaway_nick\fP (default: \fBnot set\fP) If set, and if there are no more client attached, BIP will change nickname to this \fBaway_nick\fP. Your nickname will be restored upon client connect. .TP \fBno_client_away_msg\fP (default: \fBnot set\fP) This options allows you to set an away message. This away message will be set when the last client disconnects, and removed when a client connects. .TP \fBfollow_nick\fP (default: \fBfalse\fP) If set to true, when you change nick, BIP stores the new nickname as the new default nickname value. Thus, if you are disconnected from the server, BIP will restore the correct nickname. .TP \fBautojoin_on_kick\fP (default: \fBtrue\fP) If set to false bip will not attempt to re-join a channel from which you were kicked. .TP \fBignore_first_nick\fP (default: \fBfalse\fP) If set to true, BIP will ignore the nickname sent by the client upon connect. Further nickname changes will be processed as usual. .TP \fBignore_server_capab\fP (default: \fBtrue\fP) By default bip ignores when a server advertises the CAPAB feature. Servers that support this can prefix each line with a "+" or a "-" depending if a user is registered or not. xchat checks if a server has the CAPAB feature and enables it. If you have two clients connected to a bip connection, one that supports this mode and one that does not, you see the plus and the minuses on each line in the client that does not support CAPAB. To avoid that, when a server advertises CAPAB bip simply removes it. You can set this option to false to keep using CAPAB (if you only use clients that support it for instance). .TP \fBnetwork\fP The network name. See the \fBNETWORK SECTION\fP. .TP \fBlog\fP (override global log) When \fBtrue\fP, the file logs are enabled for this connection. When \fBfalse\fP, no log file is written, logs are kept in memory. .TP \fBnick\fP BIP will send that string as your nickname upon connect. If not specified and if \fBdefault_nickname\fP is specified in the \fBuser\fP section, BIP will use that default nickname string. .TP \fBon_connect_send\fP You can specify this field more than once. BIP will send the text as is to the server. It'd be useful for a greet on connect or to send your NickServ password. .TP \fBpassword\fP This is the IRC server password, which is sent upon connection to the IRC server only. .TP \fBrealname\fP BIP will send that string as the realname part (description in whois result) upon connect. If not specified and if \fBdefault_realname\fP is specified in the \fBuser\fP section, BIP will use that default realname string. .TP \fBsasl_mechanism\fP Tells BIP to use specified SASL mechanism. Currently supported: PLAIN, EXTERNAL. PLAIN mechanism requires \fBsasl_username\fP and \fBsasl_password\fP and is the default if these are set. .TP \fBsasl_username\fP This connection's username to pass on using SASL authentication. .TP \fBsasl_password\fP This connection's password to pass on using SASL authentication. .TP \fBsource_port\fP If specified, tells BIP to connect from this port to the IRC server. .TP \fBssl_check_mode\fP (default: \fBthe user's option\fP) See \fBssl_check_mode\fP option in \fBUser\fP section. .TP \fBuser\fP BIP will send that string as the user part (usually between ! and @ in a whois result) upon connect. It's also used by the oidentd support (if enabled). If not specified and if \fBdefault_user\fP is specified in the \fBuser\fP section, BIP will use that default user string. .TP \fBvhost\fP If specified, BIP will use \fBvhost\fP as the IP address to bind to when connecting to the IRC server. It'll allow you to use a specific IP address for this network when you have more than one. This options is totally useless to people who only have one IP address. .SH CHANNEL SUB-SUB-SECTION This section defines the list of channels to join for a user on a particular network. It is to be found in the \fBconnection\fP sections and appear more than once in a \fBconnection\fP section. .TP \fBname\fP The channel name (#bip, &bip, ...). .TP \fBkey\fP The channel key if needed. .TP \fBbacklog\fP (default: \fBtrue\fP) Enable or disable backlogging of this particular channel. Setting this to true will NOT enable the backlog system, see the \fBuser\fP section. .SH IRC CLIENT CONFIGURATION .P On your IRC client, setup as many IRC servers as connections defined in your \fBconnection\fP section. .P Host and port must match values defined in \fBip\fP and \fBport\fP global option. The password must be \fIusername:password:connectionname\fR where: .RS .IP \(bu 4 username is the \fIname\fR defined in the \fIuser\fR section; .IP \(bu 4 password is the clear text value of the \fIpassword\fR corresponding to the hashed password defined in the \fIuser\fR section; .IP \(bu 4 connectionname is the \fIname\fR defined in \fIconnection\fR sub-section. .RE .SH SEE ALSO .BR bip (1), .BR bipmkpw (1) .SH AUTHOR bip authors: .br Arnaud 'nohar' Cornet .br Loïc 'Kyoshiro' Gomez Thanks to jj, YS and lafouine, for hanging around while we were coding. .br Crypto shamelessly taken from Christophe 'sexy' Devine. .br This man page is written by Loïc 'Kyoshiro' Gomez. bip-0.9.3/scripts/0000775000175000017500000000000014212410721010761 500000000000000bip-0.9.3/scripts/bip-release0000775000175000017500000000364614131537051013036 00000000000000#!/bin/sh set -e if [ ! -d src ] || [ ! -f NEWS ] ; then echo "Please run me in bip sources root." >&2 exit 1 fi release_version="$1" release_name="$2" : ${MAKEOPTS:=-j -l4} set_version() { local release_version release_version="${1}" sed -i -e '/^AC_INIT/s/\(,\[\)[^]]*/\1'${release_version}'/' configure.ac } get_version() { grep -e '^AC_INIT' configure.ac | cut -d [ -f 3 | cut -d ] -f 1 } make_distcheck() { # prepare sources autoreconf -i -Wall # Create makefile, use all possible options ./configure # run distcheck if ! make ${MAKEOPTS} distcheck; then echo "'make distcheck' fails, please try again." >&2 return 1 else true fi } git log > ChangeLog if [ -n "$release_version" ]; then # Don't forget to update NEWS file before a release expected="$(date --rfc-3339=date) (${release_version})" if [ -n "${release_name}" ]; then expected="${expected} \"${release_name}\"" fi head -n 1 NEWS | grep -q "^${expected}$" || (echo "NEWS file doesn't match the expected format (${expected})" && exit 1) set_version "${release_version}" make_distcheck || exit 1 git commit -a --gpg-sign -m "Update version and ChangeLog for bip-${release_version} release." TAG_COMMENT="Release ${release_version}" if [ -n "${release_name}" ]; then TAG_COMMENT="${TAG_COMMENT} '${release_name}'" fi git tag --sign -m "${TAG_COMMENT}" release-${release_version} set_version "${release_version}-git" git commit -a --gpg-sign -m "Add -git to version string." echo "See bip-${release_version}.tar.gz" else make_distcheck || exit 1 tarname=bip-$(get_version) prefix=bip-$(date +%Y%m%d) rm -rf "${tarname}" "${prefix}" tar -xzf "${tarname}".tar.gz rm -rf "${tarname}".tar.gz mv "${tarname}" "${prefix}" tar -czf "${prefix}".tar.gz "${prefix}" rm -rf "${prefix}" # Revert the ChangeLog. git checkout HEAD -- ChangeLog echo "See ${prefix}.tar.gz" fi # cleanup git clean -d -i -e "bip-*.tar.gz" bip-0.9.3/scripts/bipgenconfig0000775000175000017500000012550514130101550013265 00000000000000#!/usr/bin/env perl # # This file is part of the bip project # Copyright (C) 2004 2007 Arnaud Cornet and Loïc Gomez # # 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. # See the file "COPYING" for the exact licensing terms. # use strict; use IO::File; use Data::Dumper; my $bipdir = $ENV{'HOME'} . '/.bip'; my $CFILE = $bipdir . '/bip.conf.autogen'; my $sfile = $bipdir . '/bipgenconfig.store'; my $certout = $bipdir . '/bip.pem.autogen'; my $SERIALIZE_DBG = 1; my %cf; my $DEBUG = 0; my $global_done = 0; my $cert_done = 0; my $mode = 'normal'; # maximum level of nested blocks { { { } } } my $maxlevel = 5; my $bipmkpw; my $tmpcrt = "/tmp/bip-cert.cnf"; my %optcompat = ( "bl_msg_only" => "backlog_msg_only", "blreset_on_talk" => "backlog_reset_on_talk", "always_backlog" => "backlog_always", ); my %optdesc = ( 'global' => { 'ip' => { 'type' => 's', 'adv' => 1, 'default' => '0.0.0.0', 'optional' => 1, 'desc' => 'What IP address/hostname do you want bip to listen on ?' }, 'port' => { 'type' => 'i', 'adv' => 1, 'default' => '7778', 'optional' => 1, 'desc' => 'What port do you want bip to listen on ?' }, 'client_side_ssl' => { 'type' => 'b', 'adv' => 1, 'default' => 'true', 'optional' => 1, 'desc' => 'Do you want to enable client side SSL ?' }, 'client_side_ssl_pem' => { 'type' => 's', 'adv' => 1, 'optional' => 1, 'default' => '', 'desc' => 'Where is the bip.pem file (cert/key pair) ?' }, 'pid_file' => { 'type' => 's', 'adv' => 1, 'optional' => 1, 'default' => $bipdir . '/bip.pid', 'desc' => 'Where do you want the pidfile to be stored ?' }, 'log' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'desc' => 'Do you want to enable channel logging ?' }, 'log_system' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'desc' => 'Do you want to enable system logging ?' }, 'log_sync_interval' => { 'type' => 'i', 'adv' => 1, 'optional' => 1, 'default' => '5', 'depends' => 'log', 'depval' => 'true', 'desc' => 'At which interval do you want bip to force logs to be written {seconds} ?' }, 'log_level' => { 'type' => 'i', 'adv' => 1, 'default' => '3', 'optional' => 1, 'depends' => 'log', 'depval' => 'true', 'desc' => 'Define bip\'s system logs verbosity level {less 0 - 7 tremendous}:' }, 'log_root' => { 'type' => 's', 'adv' => 0, 'optional' => 1, 'default' => $bipdir . '/logs', 'depends' => 'log', 'depval' => 'true', 'desc' => 'In which directory do you want logs to be stored ?' }, 'log_format' => { 'type' => 's', 'adv' => 1, 'default' => '%n/%Y-%m/%c.%d.log', 'optional' => 1, 'depends' => 'log', 'depval' => 'true', 'desc' => 'Define the channel/private log format {see strftime, limited}:' }, }, 'network' => { 'name' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'Network\'s name' }, 'ssl' => { 'type' => 'b', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'Enable SSL for this network ?' }, 'server' => { 'type' => 'e' }, }, 'user' => { 'name' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'User\'s internal name ?' }, 'admin' => { 'type' => 'b', 'adv' => 0, 'default' => 'false', 'optional' => 1, 'desc' => 'Is user an admin ?' }, 'password' => { 'type' => 'p', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'Set a password for his bip account:' }, 'bip_use_notice' => { 'type' => 'b', 'adv' => 0, 'default' => 'false', 'optional' => 1, 'desc' => 'Do you prefer bip to use notices instead of privmsgs ?' }, 'ssl_check_mode' => { 'type' => 's', 'adv' => 1, 'optional' => 1, 'default' => 'none', 'desc' => 'Type of SSL servers certificate\'s checks' }, 'ssl_check_store' => { 'type' => 's', 'adv' => 1, 'optional' => 1, 'default' => '', 'desc' => 'Path to SSL servers\'s data storage' }, 'default_nick' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'User\'s default IRC nickname' }, 'default_user' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'User\'s default IRC username' }, 'default_realname' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'User\'s default IRC realname' }, 'backlog' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'depends' => 'log', 'depval' => 'true', 'desc' => 'Do you want to activate backlog {play back logs} system ?' }, 'backlog_lines' => { 'type' => 'i', 'adv' => 0, 'default' => '10', 'optional' => 1, 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'How much line do you want bip to play back upon client connect' . " {0 => replay everything since backlog's last reset} ?" }, 'backlog_timestamp' => { 'type' => 's', 'adv' => 0, 'optional' => 1, 'default' => 'time', 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'Use time, datetime or disable prefix in backlog', 'values' => ['none', 'time', 'datetime'] }, 'backlog_msg_only' => { 'type' => 'b', 'adv' => 0, 'optional' => 1, 'default' => 'false', 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'Only playback users messages {chan/priv}, no nick/join/... ?' }, 'backlog_always' => { 'type' => 'b', 'adv' => 0, 'optional' => 1, 'default' => 'false', 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'Always backlog {false means backlog pointers are reset after each backlog} ?' }, 'backlog_reset_on_talk' => { 'type' => 'b', 'adv' => 0, 'optional' => 1, 'default' => 'false', 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'Reset backlog each time an attached client "talks" ?' }, 'connection' => { 'type' => 'e' }, }, 'connection' => { 'name' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'Connection name (used by bip only)' }, 'network' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'postdepends' => 'networks.$value', 'desc' => 'Network to connect to' }, 'defid' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'nosave' => 1, 'desc' => 'Use default identity ?' }, 'nick' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'depends' => 'defid', 'depval' => 'false', 'desc' => 'IRC nickname on this connection ?' }, 'user' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'depends' => 'defid', 'depval' => 'false', 'desc' => 'IRC username on this connection ?' }, 'realname' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'depends' => 'defid', 'depval' => 'false', 'desc' => 'IRC realname on this connection ?' }, 'password' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'IRC server\'s password ?' }, 'vhost' => { 'type' => 's', 'adv' => 1, 'default' => '', 'optional' => 1, 'desc' => 'Connect to IRC server from this specific IP address:' }, 'source_port' => { 'type' => 'i', 'adv' => 1, 'default' => '', 'optional' => 1, 'desc' => 'Connect to IRC server from this specific port:' }, 'follow_nick' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'desc' => 'Follow nicknames changes from clients to use upon reconnection (if false, bip\'ll use config nickname)' }, 'ignore_first_nick' => { 'type' => 'b', 'adv' => 0, 'default' => 'true', 'optional' => 1, 'desc' => 'Ignore nickname change sent by a client (first one only, upon client attach)' }, 'away_nick' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'Set nickname to this value when there\'s no more client attached:' }, 'no_client_away_msg' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'Set this away message when there\'s no more client attached:' }, 'on_connect_send' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'Send this raw message upon connection to IRC server' }, 'ssl_check_mode' => { 'type' => 's', 'adv' => 1, 'optional' => 1, 'default' => '', 'desc' => 'Type of SSL servers certificate\'s checks' }, 'channel' => { 'type' => 'e' }, }, 'channel' => { 'name' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'Channel name' }, 'key' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 1, 'desc' => 'Channel key (optional)' }, }, 'server' => { 'host' => { 'type' => 's', 'adv' => 0, 'default' => '', 'optional' => 0, 'desc' => 'IRC server\'s IP address/hostname' }, 'port' => { 'type' => 'i', 'adv' => 0, 'default' => '6667', 'optional' => 0, 'desc' => 'IRC server\'s port' }, } ); my %optorder = ( 'global' => [ 'ip' , 'port' , 'client_side_ssl' , 'client_side_ssl_pem' , 'pid_file' , undef, 'log' , 'log_system' , 'log_sync_interval' , 'log_level' , 'log_root' , 'log_format' , ], 'network' => [ 'name' , 'ssl' , 'server' , ], 'user' => [ 'name' , 'password' , 'ssl_check_mode' , 'ssl_check_store' , undef, 'default_nick' , 'default_user' , 'default_realname' , undef, 'backlog' , 'backlog_lines' , 'backlog_timestamp' , 'backlog_msg_only' , 'backlog_always' , 'backlog_reset_on_talk' , 'connection' , ], 'connection' => [ 'name' , 'network' , 'defid', 'nick' , 'user' , 'realname' , 'password' , undef, 'vhost' , 'source_port' , 'follow_nick' , 'ignore_first_nick' , 'away_nick' , 'no_client_away_msg' , 'on_connect_send' , 'ssl_check_mode' , 'channel' , ], 'channel' => [ 'name' , 'key' , ], 'server' => [ 'host' , 'port' , ] ); my $clear_string = `clear`; sub myexit { warn("Error: $1"); warn("Saving configuration..."); save_config(); warn("Don't worry, your configuration has been saved ;)"); exit(1); } sub askOpt { my ($e, $curval, $mayempty) = @_; my ($o, $sel); $sel = (($curval ne undef) ? $curval : $e->{'default'}); return $sel if ($mode eq 'normal' && $e->{'adv'} eq 1); while (1) { my $opt = (defined $e->{'optional'} && $e->{'optional'} eq 1 ? 1 : 0); if ($e->{'type'} eq 'b') { $o = askbool($e->{'desc'}, $sel, 1); } elsif ($e->{'type'} eq 'p') { $o = askPass($e->{'desc'}); } else { $o = askval($e->{'desc'}, $sel, ($mayempty && ($opt ne 1 || $e->{'type'} eq 'i' ? 1 : undef)), 1); if (defined $e->{'values'} && !grep(/^$o$/, @{$e->{'values'}})) { print("The allowed values are '@{[ join '\', \'', @{$e->{'values'}} ]}'\n"); next; } } if ($o eq undef && $opt eq 0) { print("This value is mandatory, please enter a value\n"); next; } if ($e->{'type'} eq 'i' && $o !~ /^\d*$/) { print("We want a number here, please enter one\n"); next; } last; } return $o; } sub align { my ($text, $num) = @_; my ($out, $pos, $orig); $orig = $text; while ($text ne '' || $text ne undef) { $num = 60 if (!$num); $pos = rindex($text, " ", 60); $out .= "\n" if ($out); $out .= substr($text, 0, $pos); $text = substr($text, $pos+1); } $out .= " "; return $out; } sub askbool { my ($text, $default, $star) = @_; $text = "* $text" if $star; if ($default eq "true") { print align("$text [Y/n] "); } else { $default = "false"; print align("$text [y/N] "); } while (my $l = ) { chomp($l); if ($default eq "true" && $l =~ /^n$/i) { return "false"; } elsif ($default eq "false" && $l =~ /^y$/i) { return "true"; } elsif (!$default && $l eq '') { return undef; } else { return $default; } } } sub askPass { my ($text) = @_; which_bipmkpw(); print("$text ? "); my $pass = `$bipmkpw`; chomp($pass); $pass =~ s/^Password:\s*\n?//si; chomp($pass); return $pass; } sub which_bipmkpw { my ($which); return if ($bipmkpw ne '' && -x "$bipmkpw"); if (-x "/usr/bin/bipmkpw") { $bipmkpw = '/usr/bin/bipmkpw'; return; } $which = `which bipmkpw`; if ($which ne '' && -x "$which") { $bipmkpw = $which; return; } while (!$bipmkpw || ! -x "$bipmkpw") { if ($bipmkpw ne '' && (! -f $bipmkpw || ! -x $bipmkpw)) { print("No exec permission: $bipmkpw\n"); } $bipmkpw = askval("Please enter the path to bipmkpw:", undef, 1); } return; } sub askval { my ($text, $default, $skipblank, $star) = @_; $text .= " "; $text .= "[$default] " if ($default ne undef); $text = "* $text" if $star; print(align("$text")); while (my $l = ) { chomp($l); # if ($default eq undef && !$skipblank && $l eq '') { # my $q = askbool("You've entered a blank value, do you want this field to be unset (if not, it'll be set to the empty string) ?", "true"); # return undef if ($q eq 'true'); # } return ($l ne '' ? $l : $default); } } sub checkDepends { my ($n, $v) = @_; return if (!exists($v->{'depends'})); my $d = $v->{'depends'}; if (!exists($cf{'global'}->{$d})) { return "You cannot define `$n' since `$d' isn't defined"; } if (exists($v->{'depval'}) && $cf{'global'}->{$d} ne $v->{'depval'}) { return "You cannot define `$n' since `$d' isn't set to " . $v->{'depval'}; } } sub loadConfig { my ($f) = @_; my ($fh, $data, $hr); $fh = new IO::File; $data = ''; $fh->open($f) || return "Unable to open $f"; while (<$fh>) { chomp(); $data .= $_; } $fh->close; $hr = unserialize($data) || return "Invalid format in $f"; %cf = %{$hr}; $cf{'networks'} = [ values %{$cf{'networks'}} ]; $cf{'users'} = [ values %{$cf{'users'}} ]; sanitizeCompat(\%cf); foreach (@{$cf{'networks'}}) { $_->{'server'} = [ values %{$_->{'server'}} ]; } foreach my $tcu (@{$cf{'users'}}) { my $backlog_no_timestamp = delete($tcu->{'backlog_no_timestamp'}); if (defined $backlog_no_timestamp) { grep(/^$backlog_no_timestamp$/, ('false', 'true')) || return "Invalid value for backlog_no_timestamp: '$backlog_no_timestamp'"; $tcu->{'backlog_timestamp'} = $backlog_no_timestamp == 'false' ? 'time' : 'none'; } $tcu->{'connection'} = [ values %{$tcu->{'connection'}} ]; foreach my $tcc (@{$tcu->{'connection'}}) { $tcc->{'channel'} = [ values %{$tcc->{'channel'}} ]; } } return "Config loaded from $f"; } sub sanitizeCompat { my ($d) = @_; foreach (keys %$d) { if (ref($d->{$_}) eq 'ARRAY') { foreach my $d2 (@{$d->{$_}}) { sanitizeCompat($d2); } } $d->{$optcompat{$_}} = $d->{$_} if (defined $optcompat{$_}); } } sub resetConfig { my $r = askbool("Do you want to reset current loaded configuration options, networks, users... ?", 'false'); $r eq 'false' && return "Reset config aborted"; %cf = (); -e "$sfile" || return "Configuration cleared"; my $r = askbool("Do you want to delete saved configuration file $sfile too ?", 'false'); if ($r eq 'true') { unlink($sfile) || return "Unable to remove file $sfile, current config has been cleared"; return "Configuration cleared, saved-configuration file removed"; } return "Configuration cleared"; } sub setOptions { foreach my $n (@{$optorder{'global'}}) { if ($n eq undef) { print("\n"); next; } my $e = $optdesc{'global'}->{$n}; my $r = checkDepends($n, $e); if ($r) { print("$r\n") if ($DEBUG); $cf{'global'}->{$n} = undef; next; } $cf{'global'}->{$n} = askOpt($e, $cf{'global'}->{$n}); } $global_done = 1; pause(); return "Options have been set"; } sub printOptions { my $cnt = 1; foreach my $n (@{$optorder{'global'}}) { next if (!$n); my $e = $optdesc{'global'}->{$n}; next if ($e->{'type'} eq 'e' || $e->{'nosave'} eq 1); next if ($mode eq 'normal' && $e->{'adv'} eq 1); my $r = checkDepends($n, $e); if ($r) { printf('%02d.(%s - unset, missing dependency)'."\n", $cnt, $n); } elsif (exists($cf{'global'}->{$n})) { printf('%02d. %s = %s'."\n", $cnt, $n, $cf{'global'}->{$n}); } else { printf('%02d. %s - unset'."\n", $cnt, $n); } $cnt++; } pause(); return; } sub makeCert { my ($fh, $c, $o, $ou, $cn); $fh = new IO::File; $c = askval("SSL cert country :", undef, 1); $o = askval("SSL cert organisation :", "Sexy boys"); $ou = askval("SSL cert organisational unit :", "Bip"); $cn = askval("SSL cert common name :", "Bip"); $fh->open("> $tmpcrt"); return "Unable to write to $tmpcrt\n" if (!$fh); print $fh "HOME = . [ req ] distinguished_name = dn x509_extensions = v3_bip default_md = sha1 prompt = no [ dn ] C=$c O=$o OU=$ou CN=$cn [ v3_bip ] subjectKeyIdentifier=hash authorityKeyIdentifier=keyid:always"; # if (-e $certout) { # my @t = localtime(time); # my $ts = sprintf("%04d-%02d-%02d.%02d:%02d:%02d", 1900+$t[5], 1+$t[4], $t[3], $t[2], $t[1], $t[0]); # rename($certout, "$certout.$ts"); # print "Existing $certout found, renamed to $certout.$ts\n"; # } `openssl req -new -newkey rsa:4096 -x509 -days 365 -nodes -config "$tmpcrt" -out "$certout" -keyout "$certout"`; # TODO check command status `openssl x509 -subject -dates -fingerprint -noout -in "$certout"`; # TODO check command status $cert_done = 1; print "Certificate/key pair has been generated in $certout\n"; unlink("$tmpcrt"); pause(); return "Certificate/key pair has been generated in $certout"; } sub writeConfig { my ($f) = @_; my ($fh, $ts, @t); $ts = localtime(time); $fh = new IO::File; if (!$fh->open('> ' . $f)) { print("Unable to open $f for writing\n"); return; } print $fh "# vim:ft=bip:ts=2\n"; print $fh "# Auto-generated BIP IRC Proxy configuration $ts \n"; print $fh "#\n"; print $fh "### Global options\n"; foreach my $k (keys(%{$cf{'global'}})) { next if ($cf{'global'}->{$k} eq undef); next if ($optdesc{'global'}->{$k}->{'nosave'} eq 1); my $t = $optdesc{'global'}->{$k}->{'type'}; if ($t eq 's') { print $fh "$k = \"" . $cf{'global'}->{$k} . "\";\n"; } else { print $fh "$k = " . $cf{'global'}->{$k} . ";\n"; } } print $fh "\n"; print $fh "### Networks\n"; foreach my $e (@{$cf{'networks'}}) { my $out = printBlock("", 'network', $e, 1); print $fh $out; } print $fh "\n"; print $fh "### Users\n"; foreach my $e (@{$cf{'users'}}) { my $out = printBlock("", 'user', $e, 1); print $fh $out; } print $fh "\n"; $fh->close; print("Configuration saved in $f\n"); my $u = (exists($cf{'users'}) ? scalar @{$cf{'users'}} : 0); my $n = (exists($cf{'networks'}) ? scalar @{$cf{'networks'}} : 0); print "You haven't set global options\n" if (!$global_done); print "$u users defined, $n networks defined\n"; print "The certificate/key pair is in $certout\n" if ($cert_done eq 1); print "Configuration has been generated in $CFILE\n"; print "You have to rename all generated files to use them\n"; return; } sub storeConfig { my ($f) = @_; my ($fh); $fh = new IO::File; $fh->open('> ' . $f) || return "Unable to open $f for writing"; print $fh serialize(\%cf); $fh->close; return "Configuration stored in $f"; } sub printBlock { my ($prefix, $name, $e, $level) = @_; my $out = ''; fatal("Too much recursion levels ($level)") if ($level ge $maxlevel); $out .= $prefix . $name . " {\n"; foreach my $k (@{$optorder{$name}}) { next if ($k eq undef); next if ($e->{$k} eq undef); next if ($optdesc{$name}->{$k}->{'nosave'} eq 1); my $t = $optdesc{$name}->{$k}->{'type'}; if ($t eq 's' || $t eq 'p') { $out .= $prefix . "\t$k = \"" . $e->{$k} . "\";\n"; } elsif (ref($e->{$k}) eq 'ARRAY') { foreach my $e2 (@{$e->{$k}}) { $out .= printBlock($prefix . "\t", $k, $e2, $level+1); } } else { $out .= $prefix . "\t$k = " . $e->{$k} . ";\n"; } } $out .= $prefix . "};\n\n"; return $out; } sub addEntry { my ($section, $nopause) = @_; my ($e, $opts); $opts = $optdesc{$section}; foreach my $n (@{$optorder{$section}}) { if ($n eq undef) { print("\n"); next; } my $v = $optdesc{$section}->{$n}; my $r = checkDepends($n, $v); if ($r) { $e->{$n} = undef; print("$r\n") if ($DEBUG); next; } if ($v->{'type'} eq 'e') { my $first = 1; do { if ($v->{'optional'} eq 1 || !$first) { my $a = askbool("Do you want to add a new $n ?", 'true'); last if ($a eq 'false'); } print("\nAdding a new $n :\n"); my $e2 = addEntry($n, 1); if (ref($e->{$n}) eq 'ARRAY') { push(@{$e->{$n}}, $e2); } else { $e->{$n} = [ $e2 ]; } $first = 0; } while (1); } else { $e->{$n} = askOpt($v); } } pause() if (!$nopause); return $e; } sub pause { my ($txt) = @_; $txt = "Press any key to continue" if (!$txt); print("\n" . $txt . "\n"); ; } sub printMenu { my ($mhead, $mopts, $mfoot, $mask) = @_; push(@{$mhead}, undef); if ($mode eq 'normal') { push(@{$mhead}, "WARNING: non-advanced mode, some 'expert' " . "options'll be hidden !"); } else { push(@{$mhead}, undef); } push(@{$mhead}, undef); print($clear_string); print("###########################################################" . "###################\n# "); print(join("\n# ", @{$mhead})); print("\n"); print("\n"); foreach my $n (sort {$a <=> $b} keys(%{$mopts})) { if ($mopts->{$n} eq undef) { print("\n"); next; } printf(' %2d. %s%s', $n, $mopts->{$n}, "\n"); } print("\n"); print(join("\n", @{$mfoot})); print("\n"); print("\n"); return askval($mask, undef, 1); } sub printUsers { my ($txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $num, $warn, $act, $out); $mhead = [ "Bip's user list", ]; $mfoot = [ $txt ]; $mask = "Enter id of the user to edit ?"; $mopts = { 0 => 'Return to main menu'}; $mopts->{"0.5"} = undef; $num = 1; foreach my $n (@{$cf{'users'}}) { $mopts->{$num} = $n->{'name'} . ': ' . (scalar @{$n->{'connection'}}) . ' connections.'; $num++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act =~ /^\d+$/) { my $n = $cf{'users'}; my $c = $num-1; if (($num-$act) le 0) { $out = "There are only $c users"; } else { $out = printEditUser($act-1); } } else { $out = "Invalid user ID"; } printUsers($out); } sub printNetworks { my ($txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $num, $warn, $act, $out); $mhead = [ "Bip's network list", ]; $mfoot = [ $txt ]; $mask = "Enter ID of the network to edit ?"; $mopts = { 0 => 'Return to main menu'}; $mopts->{"0.5"} = undef; $num = 1; foreach my $n (@{$cf{'networks'}}) { $mopts->{$num} = $n->{'name'} . ': ' . (scalar @{$n->{'server'}}) . ' servers, SSL ' . ($n->{'ssl'} eq 'true' ? 'enabled' : 'disabled'); $num++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act =~ /^\d+$/) { my $n = $cf{'networks'}; my $c = $num-1; if (($num-$act) le 0) { $out = "There are only $c networks"; } else { $out = printEditNetwork($act-1); } } else { $out = "Invalid network ID"; } printNetworks($out); } sub addChannel { my ($uid, $cid) = @_; my ($cnt, @o, $n, $c, $name); return "Invalid user ID $uid" if ((scalar @{$cf{'users'}}) le $uid); $n = $cf{'users'}[$uid]; return "Invalid connection ID $cid" if ((scalar @{$n->{'connection'}}) le $cid); my $e = addEntry('channel'); if ($e) { push(@{$n->{'connection'}[$cid]->{'channel'}}, $e); return "Channel " . $e->{'name'} . " added"; } else { return "Channel add failed"; } } sub addServer { my ($id) = @_; return "Invalid network ID $id" if ((scalar @{$cf{'networks'}}) le $id); my $e = addEntry('server'); if ($e) { push(@{$cf{'networks'}[$id]->{'server'}}, $e); return "Server " . $e->{'host'} . " added"; } else { return "Server add failed"; } } sub addConnection { my ($id) = @_; return "Invalid user ID $id" if ((scalar @{$cf{'users'}}) le $id); my $e = addEntry('connection'); if ($e) { push(@{$cf{'users'}[$id]->{'connection'}}, $e); return "Connection " . $e->{'name'} . " added"; } else { return "Connection add failed"; } } sub deleteServer { my ($net, $sid) = @_; my ($sname, $ss, $cnt, @o); return "Invalid network ID $net" if ((scalar @{$cf{'networks'}}) le $net); $ss = $cf{'networks'}[$net]->{'server'}; return "Invalid server ID $sid" if ((scalar @{$ss}) lt $sid); @o = (); $cnt = 0; foreach my $s (@{$ss}) { if ($sid ne $cnt) { push(@o, $s); } else { $sname = $s->{'host'}; } $cnt++; } $cf{'networks'}[$net]->{'server'} = [ @o ]; return "Server $sname removed"; } sub delUser { my ($id) = @_; my ($cnt, @o, $name); return "Invalid user ID $id" if ((scalar @{$cf{'users'}}) le $id); $cnt = 0; @o = (); foreach my $n (@{$cf{'users'}}) { if ($id ne $cnt) { push(@o, $n); } else { $name = $n->{'name'}; } $cnt++; } $cf{'users'} = [ @o ]; return "User $name removed"; } sub delNetwork { my ($id) = @_; my ($cnt, @o, $name); return "Invalid network ID $id" if ((scalar @{$cf{'networks'}}) le $id); $cnt = 0; @o = (); foreach my $n (@{$cf{'networks'}}) { if ($id ne $cnt) { push(@o, $n); } else { $name = $n->{'name'}; } $cnt++; } $cf{'networks'} = [ @o ]; return "Network $name removed"; } sub deleteConn { my ($uid, $cid) = @_; my ($cnt, @o, $n, $name); return "Invalid user ID $uid" if ((scalar @{$cf{'users'}}) le $uid); $n = $cf{'users'}[$uid]; return "Invalid connection ID $cid" if ((scalar @{$n->{'connection'}}) le $cid); $cnt = 0; @o = (); foreach my $n (@{$n->{'connection'}}) { if ($cid ne $cnt) { push(@o, $n); } else { $name = $n->{'name'}; } $cnt++; } $cf{'users'}[$uid]->{'connection'} = [ @o ]; return "Connection $name removed"; } sub deleteChannel { my ($uid, $cid, $chid) = @_; my ($cnt, @o, $n, $c, $name); return "Invalid user ID $uid" if ((scalar @{$cf{'users'}}) le $uid); $n = $cf{'users'}[$uid]; return "Invalid connection ID $cid" if ((scalar @{$n->{'connection'}}) le $cid); $c = $n->{'connection'}[$cid]; return "Invalid channel ID $chid" if ((scalar @{$c->{'channel'}}) le $chid); $cnt = 0; @o = (); foreach my $n (@{$c->{'channel'}}) { if ($chid ne $cnt) { push(@o, $n); } else { $name = $n->{'name'}; } $cnt++; } $cf{'users'}[$uid]->{'connection'}[$cid]->{'channel'} = [ @o ]; return "Channel $name removed"; } sub printEditConnOptions { my ($num, $num2, $txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $warn, $act, $out); my ($n, $c, $name, $sub, $cnt); return "Invalid user ID $num" if ((scalar @{$cf{'users'}}) le $num); $n = $cf{'users'}[$num]; return "Invalid connection ID $num2" if ((scalar @{$n->{'connection'}}) le $num2); $c = $n->{'connection'}[$num2]; $name = $c->{'name'}; $mhead = [ "Edit connection options $name/" . $n->{'name'}, ]; $mfoot = [ $txt ]; $mopts = { 0 => 'Return to connection ' . $name, "0.5" => undef, }; $cnt = 1; my %oo = (); foreach my $s (@{$optorder{'connection'}}) { next if (!$s); next if ($optdesc{'connection'}->{$s}->{'type'} eq 'e'); next if ($optdesc{'connection'}->{$s}->{'nosave'} eq 1); next if ($mode eq 'normal' && $optdesc{'connection'}->{$s}->{'adv'} eq 1); $mopts->{$cnt} = "Change $s: "; $mopts->{$cnt} .= $c->{$s} if (defined $c->{$s}); $oo{$cnt} = $s; $cnt++; } $act = int(printMenu($mhead, $mopts, $mfoot, $mask)); print($clear_string); if ($act eq 0) { return; } elsif ($act =~ /^\d+$/) { my $c = $cnt-1; if (($cnt-$act) le 0) { $out = "There are only $c options"; } else { my $on = $oo{$act}; $cf{'users'}[$num]->{'connection'}[$num2]->{$on} = askOpt($optdesc{'connection'}->{$on}, $cf{'users'}[$num]->{'connection'}[$num2]->{$on}); $out = "Option $on set"; pause(); } } else { $out = "Invalid option ID"; } printEditConnOptions($num, $num2, $out); } sub printEditConnection { my ($num, $num2, $txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $warn, $act, $out); my ($n, $name, $sub, $cnt, $c); return "Invalid user ID $num" if ((scalar @{$cf{'users'}}) le $num); $n = $cf{'users'}[$num]; return "Invalid connection ID $num2" if ((scalar @{$n->{'connection'}}) le $num2); $c = $n->{'connection'}[$num2]; $name = $c->{'name'}; $sub = $c->{'channel'}; $mhead = [ "Edit connection $name/" . $n->{'name'}, ]; $mfoot = [ $txt ]; $mask = "What do you want to do ?"; $mopts = { 0 => 'Return to user ' . $n->{'name'}, 1 => 'Add a channel', 2 => 'Edit options', 3 => 'Remove this connection', "3.5" => undef, }; $cnt = 4; foreach my $s (@{$sub}) { $mopts->{$cnt} = "Delete channel " . $s->{'name'}; $mopts->{$cnt} .= '/' . $s->{'key'} if (defined $s->{'key'} && $s->{'key'} ne ''); $cnt++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act eq 1) { $out = addChannel($num, $num2); } elsif ($act eq 2) { return printEditConnOptions($num, $num2); } elsif ($act eq 3) { return deleteConn($num, $num2); } elsif ($act =~ /^\d+$/) { my $c = $cnt-4; if (($cnt-$act) le 0) { $out = "This connection has only $c channels"; } else { $out = deleteChannel($num, $num2, $act-4); } } else { $out = "Invalid channel ID"; } printEditConnection($num, $num2, $out); } sub printEditUserOptions { my ($num, $txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $warn, $act, $out); my ($n, $name, $sub, $cnt); return "Invalid user ID $num" if ((scalar @{$cf{'users'}}) le $num); $n = $cf{'users'}[$num]; $name = $n->{'name'}; $mhead = [ "Edit user $name options", ]; $mfoot = [ $txt ]; $mask = "What do you want to do ?"; $mopts = { 0 => 'Return to user ' . $name, "0.5" => undef, }; $cnt = 1; my %oo = (); foreach my $s (@{$optorder{'user'}}) { next if (!$s); next if ($optdesc{'user'}->{$s}->{'type'} eq 'e'); next if ($optdesc{'user'}->{$s}->{'nosave'} eq 1); next if ($mode eq 'normal' && $optdesc{'user'}->{$s}->{'adv'} eq 1); $mopts->{$cnt} = "Change $s: "; $mopts->{$cnt} .= $n->{$s} if (defined $n->{$s}); $oo{$cnt} = $s; $cnt++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act =~ /^\d+$/) { my $c = $cnt-1; if (($cnt-$act) le 0) { $out = "There are only $c options"; } else { my $on = $oo{$act}; $cf{'users'}[$num]->{$on} = askOpt( $optdesc{'user'}->{$on}, $cf{'users'}[$num]->{$on}); $out = "Option $on set"; pause(); } } else { $out = "Invalid option ID"; } printEditUserOptions($num, $out); } sub printEditUser { my ($num, $txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $warn, $act, $out); my ($n, $name, $sub, $cnt); return "Invalid user ID $num" if ((scalar @{$cf{'users'}}) le $num); $n = $cf{'users'}[$num]; $name = $n->{'name'}; $sub = $n->{'connection'}; $mhead = [ "Edit user $name", ]; $mfoot = [ $txt ]; $mask = "What do you want to do ?"; $mopts = { 0 => 'Return to users list', 1 => 'Add a connection', 2 => 'Edit options', 3 => 'Remove this user', "3.5" => undef, }; $cnt = 4; foreach my $s (@{$sub}) { $mopts->{$cnt} = "Edit connection " . $s->{'name'}; $cnt++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act eq 1) { $out = addConnection($num); } elsif ($act eq 2) { return printEditUserOptions($num); } elsif ($act eq 3) { return delUser($num); } elsif ($act =~ /^\d+$/) { my $c = $cnt-4; if (($cnt-$act) le 0) { $out = "This user has only $c connections"; } else { $out = printEditConnection($num, $act-4) } } else { $out = "Invalid connection ID"; } printEditUser($num, $out); } sub printEditNetwork { my ($num, $txt) = @_; my ($mopts, $mhead, $mfoot, $mask, $warn, $act, $out); my ($n, $name, $sub, $cnt); return "Invalid network ID $num" if ((scalar @{$cf{'networks'}}) le $num); $n = $cf{'networks'}[$num]; $name = $n->{'name'}; $sub = $n->{'server'}; $mhead = [ "Edit network $name", ]; $mfoot = [ $txt ]; $mask = "What do you want to do ?"; $mopts = { 0 => 'Return to networks list', 1 => 'Add a server', 2 => 'Remove this network', "2.5" => undef, }; $cnt = 3; foreach my $s (@{$sub}) { $mopts->{$cnt} = "Delete server: " . $s->{'host'} . '/' . $s->{'port'}; $cnt++; } $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { return; } elsif ($act eq 1) { $out = addServer($num); } elsif ($act eq 2) { return delNetwork($num); } elsif ($act =~ /^\d+$/) { my $c = $cnt-3; if (($cnt-$act) le 0) { $out = "This network has only $c servers"; } else { $out = deleteServer($num, $act-3) } } else { $out = "Invalid server ID"; } printEditNetwork($num, $out); } sub main_menu { my ($txt) = @_; my ($act, $out, $warn, $mopts, $mhead, $mfoot); my ($mhead, $mask); $mopts = { 1 => 'Set global options', 2 => 'Add a new network', 3 => 'Add a new user', 3.5 => undef, 4 => 'View global options', 5 => 'View/Edit/Delete networks', 6 => 'View/Edit/Delete users', 7 => 'Generate a server certificate/key pair', 8 => 'Switch to ' . invMode($mode) . ' mode', 8.5 => undef, 10 => 'Exit: store, write configuration and exit', 11 => 'Exit without saving', 12 => 'Store configuration for later use', 12.5 => undef, 20 => 'Reset config options', 21 => 'Load stored config', 22 => 'Parse and load current config (todo)', }; $mhead = [ "Welcome to bip configuration program.", "This script will help you build a configuration file", ]; $mfoot = [ $txt ]; $mask = "What do you want to do ?"; $act = printMenu($mhead, $mopts, $mfoot, $mask); print($clear_string); if ($act eq 0) { } elsif ($act eq 1) { $out = setOptions(); } elsif ($act eq 2) { $out = addEntry('network'); if ($out) { push(@{$cf{'networks'}}, $out); $out = "New network added"; } else { $out = "Network add failed"; } } elsif ($act eq 3) { $out = addEntry('user'); if ($out) { push(@{$cf{'users'}}, $out); $out = "New user added"; } else { $out = "User add failed"; } } elsif ($act eq 4) { $out = printOptions(); } elsif ($act eq 5) { $out = printNetworks(); } elsif ($act eq 6) { $out = printUsers(); } elsif ($act eq 7) { $out = makeCert(); } elsif ($act eq 8) { $mode = invMode(); $out = "Ok, configuration mode set to $mode"; } elsif ($act eq 10) { print Dumper(\%cf) if ($DEBUG); $out = storeConfig($sfile); print ("$out\n") if ($out); writeConfig($CFILE); exit(0); } elsif ($act eq 11) { print Dumper(\%cf) if ($DEBUG); exit(0); } elsif ($act eq 12) { $out = storeConfig($sfile); print ("$out\n") if ($out); pause(); } elsif ($act eq 20) { $out = resetConfig(); } elsif ($act eq 21) { $out = loadConfig($sfile); } main_menu($out); } sub invMode { return ($mode eq 'advanced' ? 'normal' : 'advanced'); } if (! -e $bipdir) { mkdir($bipdir) || fatal("Unable to create bip's dir `$bipdir'"); } elsif (! -d $bipdir) { fatal("Bip's dir `$bipdir' already exists and is not a directory"); } elsif (! -w $bipdir) { fatal("Bip's dir `$bipdir' already exists and is not writable"); } main_menu(); #sets config backlog #different user/nick/real ? #################### # Serialize code, from Scott Hurring's serialize serialize module # see http://hurring.com/ for more # TODO maybe use Storable ? sub serialize { my ($value) = @_; return serialize_value($value); } sub serialize_key { my ($value) = @_; my $s; # Serialize this as an integer if ($value =~ /^\d+$/) { # Kevin Haidl - PHP can only handle (((2**32)/2) - 1) # before value must be serialized as a double if (abs($value) > ((2**32)/2-1)) { $s = "d:$value;"; } else { $s = "i:$value;"; } } # Serialize everything else as a string else { my $vlen = length($value); $s = "s:$vlen:\"$value\";"; } return $s; } sub serialize_value { my ($value) = @_; my $s; $value = defined($value) ? $value : ''; # This is a hash ref if ( ref($value) =~ /hash/i) { #The data in the hashref my $num = keys(%{$value}); $s .= "a:$num:{"; foreach my $k ( keys(%$value) ) { $s .= serialize_key( $k ); $s .= serialize_value( $$value{$k} ); } $s .= "}"; } # This is an array ref elsif ( ref($value) =~ /array/i) { #The data in the arrayref my $num = @{$value}; $s .= "a:$num:{"; for (my $k=0; $k < @$value; $k++ ) { $s .= serialize_key( $k ); $s .= serialize_value( $$value[$k] ); } $s .= "}"; } # This is a double # Thanks to Konrad Stepien # for pointing out correct handling of negative numbers. elsif ($value =~ /^\-?(\d+)\.(\d+)$/) { $s = "d:$value;"; } # This is an integer elsif ($value =~ /^\-?\d+$/) { # Kevin Haidl - PHP can only handle (((2**32)/2) - 1) # before value must be serialized as a double if (abs($value) > ((2**32)/2-1)) { $s = "d:$value;"; } else { $s = "i:$value;"; } } # This is a NULL value # # Only values of "\0" will be serialized as NULL # Empty strings are not NULL, they are simply empty strings. # @note Differs from v0.7 where string "NULL" was serialized as "N;" elsif ($value eq "\0") { $s = "N;"; } # Anything else is interpreted as a string else { my $vlen = length($value); $s = "s:$vlen:\"$value\";"; } return $s; } sub unserialize { my ($string) = @_; return unserialize_value($string); } sub unserialize_value { my ($value) = @_; # Thanks to Ron Grabowski [ronnie (at) catlover.com] for suggesting # the need for single-value unserialize code # This is an array if ($value =~ /^a:(\d+):\{(.*)\}$/) { serialize_dbg("Unserializing array"); my @chars = split(//, $2); # Add one extra char at the end so that the loop has one extra # cycle to hit the 'set' state and set the final value # Otherwise it'll terminate before setting the last value push(@chars, ';'); return unserialize_sub({}, $1*2, \@chars); } # This is a single string elsif ($value =~ /^s:(\d+):(.*);$/) { serialize_dbg("Unserializing single string ($value)"); #$string =~ /^s:(\d+):/; return $2; #return substr($string, length($1) + 4, $1); } # This is a single integer or double value elsif ($value =~ /^(i|d):(\-?\d+\.?\d+?);$/) { serialize_dbg("Unserializing integer or double ($value)"); return $2 #substr($string, 2) + 0; } # This is a NULL value # Thanks to Julian Jares [jjares at uolsinectis.com.ar] elsif ($value == /^N;$/i) { serialize_dbg("Unserializing NULL value ($value)"); return "\0"; } # This is a boolean # Thanks to Charles M Hall (cmhall at hawaii dot edu) elsif ($value =~/^b:(\d+);$/) { serialize_dbg("Unserializing boolean value ($value)"); return $1; } # Invalid data else { serialize_dbg("Unserializing BAD DATA!\n($value)"); die("Trying to unserialize bad data!"); return ''; } } sub unserialize_sub { my ($hashref, $keys, $chars) = @_; my ($temp, $keyname, $skip, $strlen); my $mode = 'normal'; #default mode serialize_dbg("> unserialize: $hashref, $keys, $chars"); # Loop through the data char-by-char, eating them as we go... while ( defined(my $c = shift @{$chars}) ) { serialize_dbg("\twhile [$mode] = $c (skip=$skip)"); # Processing a serialized string # Format: s:length:"data" if ($mode eq 'string') { $skip = 1; #how many chars should 'readstring' skip? #skip initial quote " at the beginning. #find out how many chars need to be read if ($c =~ /\d+/) { #get the length of string $strlen = $strlen . $c; } #if we already have a length, and see ':', we know that #the actual string is coming next (see format above) if (($strlen =~ /\d+/) && ($c eq ':')) { serialize_dbg("[string] length = $strlen"); $mode = 'readstring'; } } # Read $strlen number of characters into $temp elsif ($mode eq 'readstring') { next if ($skip && ($skip-- > 0)); $mode = 'set', next if (!$strlen--); $temp .= $c; } # Process a serialized integer # Format: i:data elsif ($mode eq 'integer') { next if ($c eq ':'); $mode = 'set', next if ($c eq ';'); # Grab the digits # Thanks to Konrad Stepien # for pointing out correct handling of negative numbers. if ($c =~ /\-|\d+/) { if ($c eq '-') { $temp .= $c unless $temp; } else { $temp .= $c; } } } # Process a serialized double # Format: d:data elsif ($mode eq 'double') { next if ($c eq ':'); $mode = 'set', next if ($c eq ';'); # Grab the digits # Thanks to Konrad Stepien # for pointing out correct handling of negative numbers. if ($c =~ /\-|\d+|\./) { if ($c eq '-') { $temp .= $c unless $temp; } else { $temp .= $c; } } } # Process a serialized NULL value # Format: N # Thanks to Julian Jares [jjares at uolsinectis.com.ar] elsif ($mode eq 'null') { # Set $temp to something perl will recognize as null "\0" # Don't unserialize as an empty string, becuase PHP # serializes empty srings as empty strings, not null. $temp = "\0"; $mode = 'set', next; } # Process an array # Format: a:num_of_keys:{...} elsif ($mode eq 'array') { # Start of array definition, start processing it if ($c eq '{') { $temp = unserialize_sub( $$hashref{$keyname}, ($temp*2), $chars ); # If temp is an empty array, change to {} # Thanks to Charles M Hall (cmhall at hawaii dot edu) if(!defined($temp) || $temp eq "") { $temp = {}; } $mode = 'set', next; } # Reading in the number of keys in this array elsif ($c =~ /\d+/) { $temp = $temp . $c; serialize_dbg("array_length = $temp ($c)"); } } # Do something with the $temp variable we read in. # It's either holding data for a key or a value. elsif ($mode eq 'set') { # The keyname has already been set, so that means # $temp holds the value if (defined($keyname)) { serialize_dbg("set [$keyname]=$temp"); $$hashref{$keyname} = $temp; # blank out keyname undef $keyname; } # $temp holds a keyname else { serialize_dbg("set KEY=$temp"); $keyname = $temp; } undef $temp; $mode = 'normal'; # dont eat any chars } # Figure out what the upcoming value is and set the state for it. if ($mode eq 'normal') { # Blank out temp vars used by previous state. $strlen = $temp = ''; if (!$keys) { serialize_dbg("return normally, finished processing keys"); return $hashref; } # Upcoming information is integer if ($c eq 'i') { $mode = 'integer'; $keys--; } # Upcoming information is a bool, # process the same as an integer if ($c eq 'b') { $mode = 'integer'; $keys--; } # Upcoming information is a double if ($c eq 'd') { $mode = 'double'; $keys--; } # Upcoming information is string if ($c eq 's') { $mode = 'string'; $keys--; } # Upcoming information is array/hash if ($c eq 'a') { $mode = 'array'; $keys--; } # Upcoming information is a null value if ($c eq 'N') { $mode = 'null'; $keys--; } } } #while there are chars to process # You should never hit this point. # If you do hit this, it means that the code was expecting more # characters than it was given. # Perhaps your data was unexpectedly truncated or mutilated? serialize_dbg("> unserialize_sub ran out of chars when it was expecting more."); die("unserialize_sub() ran out of characters when it was expecting more."); return 0; } sub serialize_dbg { my ($string) = @_; if ($SERIALIZE_DBG) { print $string ."\n"; } } bip-0.9.3/samples/0000775000175000017500000000000014212410721010736 500000000000000bip-0.9.3/samples/bip.conf0000664000175000017500000002371414212335655012322 00000000000000# bip default config file. # Thou shoult change thy password # Default values are commented out. # Listening IP address. This is the IP address bip will listen for incoming # client connections. #ip = "0.0.0.0"; # To connect a client to bip, try the port below, and # be sure to set the password to the value # specified in the network you want to connect to. # Port is 7778 by default. #port = 7778; # If you set this to true, you'll only be able to connect to bip # with a SSL capable IRC client. Be sure to generate a certificate # for bip using scripts/bipgenconfig. #client_side_ssl = false; # This is the file containing the SSL cert/key pair bip'll use to # serve SSL clients. If unset, it defaults to /bip.pem # Supply at least 2048-bit parameters, for example using openssl: # openssl dhparam -out dh.pem 2048; #client_side_ssl_pem = "/bip.pem"; # OpenSSL cipher lists used with SSL client connections. # If not set, OpenSSL default ciphers will be used. See OpenSSL ciphers # command. An example value: "ECDHE-RSA-AES128-GCM-SHA256". #client_side_ciphers = ; # DH parameters bip'll use when serving SSL clients. # Supply at least 2048-bit parameters, for example using openssl: # openssl dhparam -out dh.pem 2048; #client_side_dh_param = "/dh.pem"; # Default OpenSSL cipher lists used with outgoing connections to IRC servers. # If not set, OpenSSL default ciphers will be used. See OpenSSL ciphers # command. An example value: "ECDHE-RSA-AES128-GCM-SHA256". # If not set, OpenSSL default ciphers will be used. #ssl_default_ciphers = ; # Define where the pidfile should be stored. Defaults to /bip.pid. #pid_file=""; # Defaults to false, whether to write oidentd.conf files (see below). #write_oidentd = true; # Defaults to /.oidentd.conf #oidentd_file=""; # Set to false and uncomment this line to disable logging and backlogging. #log = true; # Define bip's log level : # 0 : only fatal errors # 1 : add others errors # 2 : add warnings # 3 : add info messages # 4 : add debug messages #log_level = 3; # This is where logs go. Channel and private messages will use that # configuration value as a prefix, and then log_format to determine # full log filename. Defaults to /logs. #log_root = ""; # Set to false and uncomment this line to disable bip's internal messages # logging. This is not recommended, a better option is to reduce log_level. #log_system = true; # Log format allows you to make log filenames depend on the log line's # attributes. Here's a list : # %u -> username # %n -> network name # %Y -> 4 digit year # %m -> 2 digit month # %d -> 2 digit day # %h -> 2 digit hour of the day # %c -> destination (#chan, nick, ...) #log_format = "%u/%n/%Y-%m/%c.%d.log"; # Sets the frequency (in seconds) of log syncing (real write to kernel) #log_sync_interval = 5; # Sets the initial delay (in seconds) before a reconnection attempt. # The delay increases with the number of attempts: # delay = reconn_timer * number of attempts #reconn_timer = 120; # Network definition, a name and server info #network { # name = "iiens"; # server { host = "irc.iiens.net"; port = 6667; }; #}; #network { # name = "oftc"; # server { host = "irc.oftc.net"; port = 6667; }; # server { host = "other.oftc.server"; port = 6667; }; #}; # SSL network sample. SSL is per-network option, not per-server ! #network { # name = "oftcs"; # ssl = true; # server { host = "ircs.oftc.net"; port = 9999; }; #}; # Configuration example with one user who connects to two irc networks # To use the multi-server feature: # - define the connections # - chose and setup a different login for each connection # on your irc client: # - Use the multi server feature of your client, the server being each time # the server where bip is running. In your client setup server password to: # username:password:connectionname # - do not store the password in clear here, use the bipmkpw util to generate # a hash # User structure is grouping information for a given user #user { # The name in bip of the user, required. This is used by bip only. #name = ; # This user's password (md5(md5("tata"))) with seed - generated by # bipmkpw, for example: "3880f2b39b3b9cb507b052b695d2680859bfc327". #password = ; # Set this to true if you want this user to have admin privileges on # bip. User will be able to RELOAD bip and see all users' configuration # (except pass). #admin = false; # When bip_use_notice is true, bip will send internal messages like # disconnection notifications or /BIP commands replies as notices # instead of private messages. The default is false. #bip_use_notice = false; # SSL certificates checking mode for user: # - "none" to accept anything; # - "basic" to accept if the certificate is contained in the store; # In "basic" mode, encountered untrusted certificates can be added to # the store interactively by connecting a client and "trusting" them. # - "ca" to do a complete certificate chain checking with the objects # in the store below (you have to put in it every cert, CRL, up to the # root CA). You have to build your store manually, so you may prefer # using "basic" unless you're a crypto zealot... #ssl_check_mode = "none"; # Location of the user's store for server SSL certificate check # In "basic" mode, that must point to a single file with all trusted # certs concatenated together (the interactive "trust" appends to this # file). # In "ca" mode, it can be either: # - a directory of a standard openssl store; you must put PEM objects # (certificates, CRLs...) with .pem extension and run `c_rehash .' in it # - a certificate bundle file containing one or more certificates in PEM # format, enclosed in BEGIN CERTIFICATE / END CERTIFICATE lines # - unspecified: in this case, bip will attempt to use the default # certificate store of the OpenSSL it is built against. This is the default. #ssl_check_store = ""; # Some networks (OFTC at least) allow you to authenticate to nickserv # using client side certificates, see # http://www.oftc.net/oftc/NickServ/CertFP # This is where you put your user's certificate. # The default is not to use a certificate. #ssl_client_certfile = ""; # These will be the default for each connections. #default_nick = ; #default_user = ; #default_realname = ; # Makes bip send the log of each channel and privates while # you were not connected to the proxy upon connection. #backlog = true; # enable backlog #backlog_lines = 10; # number of lines in backlog, 0 means no limit # When true, backlog even lines already backlogged, do not reset backlog # when no client attached anymore. #backlog_always = false; # "none", "time" or "datetime": disables time stamps, use time or datetime. #backlog_timestamp = "time"; # This parameter is deprecated, use backlog_timestamp instead. #backlog_no_timestamp = false; # implies backlog_timestamp = "none"; # If blreset_on_talk talking on an irc network has the same effect of # issuing /bip blreset , meaning that stuffed logged # before the command won't be read back on backlog. #backlog_reset_on_talk = false; # If you have backlog_reset_on_talk set to true, talking in a query # will reset the backlog for the query. Same goes for channel. With the # following option set to true, talking in a connection will reset the # whole connection. The backlog for the current network is reset. #backlog_reset_connection = false; # If bl_msg_only is true, only channel and private messages will be # backlogged upon the reconnection of a client. Default is false, thus # joins, parts, quits, nick changes, topic changes, ... are backlogged. #backlog_msg_only = false; # A user can have mutiple connections to irc networks. # define a connection: #connection { # used by bip only, required (for example: "oftc"). #name = ; # which ircnet to connect to, required (for example: "oftc"). #network = ; #log = false; # disable or enable logging and backlogging for # the current connection. Overrides global # (top-level) log parameter. # You can define ssl_check_mode here, if you want a different # behavior than the one defined in the parent level ('user' section). #ssl_check_mode = "none"; # If you have multiple IP addresses, you can set the one you # want bip to use here. This options is totally useless to people who # only have one IP address. #vhost = ""; # When source_port is defined, bip will connect to the IRC # server from this port number. That means the IRC server will # see the socket coming from :source_port. #source_port = 10000; # These will be sent to the real server. Nick, user and realname are # required. Default values are defined at the parent level # (default_nick, default_user, default_realname). #nick = "othernick"; #user = "otheruser"; #realname = "otheruser"; #password = "server password"; #You can specify this field more than once. BIP will send the text as is to the server. #on_connect_send = "PRIVMSG NickServ :IDENTIFY nspassword"; # You can connect with SASL on networks supporting it #sasl_username = "username"; #sasl_password = "sikioure password"; #sasl_mechanism = "PLAIN"; # Some options: #away_nick = "bip`away"; # Away message to be set when no client is connected #no_client_away_msg = "Having life, knock again later"; #follow_nick = false; #ignore_first_nick = false; #autojoin_on_kick = true; #ignore_server_capab = true; # Autojoined channels: #channel { name = "#bip"; }; # name is required. # Password protected channel #channel { # name = "#elite_UnDeRgR0uNd"; # key = "sikiour"; #}; #another channel #channel { # name = "#huge(28)_activity"; # disable backlogging of this channel. # backlog = false; #}; #}; # another connection (optional) #connection { #name = "iiens"; # used by bip only #network = "iiens"; # which ircnet to connect to # Some options: #away_nick = "bip`away"; #follow_nick = true; #ignore_first_nick = true; # Autojoined channels: #channel { name = "#bip"; }; #}; #}; bip-0.9.3/samples/bip.vim0000664000175000017500000001336214212335655012166 00000000000000" Vim syntax file " Language: Bip configuration file " Copyright: Copyright (C) 2004 Arnaud Cornet and Loïc Gomez " License: This file is part of the bip project. See the file 'COPYING' for " the exact licensing terms. " " " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn case ignore " Global elements syn match bipComment contained %\s*#.*$% syn match bipEndError contained /\(#.*\)\@ else command -nargs=+ HiLink hi def link endif HiLink bipMain Error HiLink bipNetwork Error HiLink bipChannel Error HiLink bipServer Error HiLink bipUser Error HiLink bipConnection Error " We do not HiLink bipWhite, siec we only want to ignore it. HiLink bipKeyword Keyword HiLink bipNKeyword Keyword HiLink bipUKeyword Keyword HiLink bipCKeyword Keyword HiLink bipSKeyword Keyword HiLink bipCoKeyword Keyword HiLink bipComment Comment HiLink bipMatch Include HiLink bipStringV Error HiLink bipBoolV Error HiLink bipNumericV Error HiLink bipIPV Error HiLink bipEndError Error HiLink bipString String HiLink bipBool Boolean HiLink bipNumeric Number HiLink bipIP String HiLink bipAddrTk String HiLink bipDot Delimiter HiLink bipSlash Delimiter HiLink bipMask Number delcommand HiLink let b:current_syntax = "bip" " vim: ts=8 bip-0.9.3/bip.10000664000175000017500000000146113242620630010054 00000000000000.TH BIP 1 "10 October 2005" .SH NAME bip \- BIP IRC Proxy .SH SYNOPSIS \fBbip\fP [ \fB-n\fP ] [ \fB-f\fP \fIconfig_file\fP ] [ \fB-s\fP \fIbipdir\fP ] [ \fB-h\fP ] .SH DESCRIPTION BIP is an IRC Proxy .SH OPTIONS .TP \fB-n\fP Don't daemonize. Log into stderr. .TP \fB-f\fP config_file Use config_file as the configuration file. If no config file is given, bip will try to open ~/.bip/bip.conf. .TP \fB-s\fP bipdir Set bip home directory to bipdir instead of $HOME/.bip. \fBbipdir\fP is the default parent directory for client certificate, configuration, logs, pid, oidentd. .TP \fB-h\fP Help. .SH SEE ALSO bip.conf .SH AUTHOR Arnaud 'nohar' Cornet Loïc 'Kyoshiro' Gomez Thanks to jj, YS and lafouine, for hanging around while we were coding. Crypto shamelessly taken from Christophe 'sexy' Devine. bip-0.9.3/bipmkpw.10000664000175000017500000000100113242620630010741 00000000000000.TH BIPMKPW 1 "6 July 2005" .SH NAME bipmkpw \- Password hasher for BIP .SH SYNOPSIS \fBbipmkpw\fP .SH DESCRIPTION bipmkpw converts a password into the double-hash used by bip. Copy the generated output from bipmkpw into bip config file. Password cannot contain spaces. .SH SEE ALSO .BR bip.conf (5) .BR bip (1) .SH COPYRIGHT Arnaud 'nohar' Cornet Loïc 'Kyoshiro' Gomez Thanks to jj, YS and lafouine, for hanging around while we were coding. Crypto shamelessly taken from Christophe 'sexy' Devine. bip-0.9.3/systemd/0000775000175000017500000000000014132774061010775 500000000000000bip-0.9.3/systemd/bip-config.service0000664000175000017500000000047513242620630014313 00000000000000[Unit] Description=Preprocess Bip configuration After=local-fs.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=no # Packagers must define: # - ExecStart=/path/to/bip_env.sh # - Environment='BIP_DEFAULT_CONFIG=/path/to/default/bip' # using a unit file drop-in bip-config.service.d/.conf bip-0.9.3/systemd/bip.service0000664000175000017500000000072614132774023013054 00000000000000[Unit] Description=Bip IRC Proxy Documentation=man:bip(1) man:bip.conf(5) Requires=network.target Wants=bip-config.service After=bip-config.service [Service] EnvironmentFile=/run/sysconfig/bip Type=forking User=bip Group=bip ExecStartPre=/bin/sh -c '[ ${ENABLED:-1} != 0 ]' ExecStart=/usr/bin/bip $DAEMON_ARGS ExecReload=/bin/kill -HUP $MAINPID RuntimeDirectory=bip RuntimeDirectoryMode=0750 KillMode=process Restart=on-abnormal [Install] WantedBy=multi-user.target bip-0.9.3/systemd/README0000664000175000017500000000137713242620630011576 00000000000000Notes about systemd unit files for bip. Distro specific commandline configuration is provided by installing a script named. A default script named bip_env.sh is provided. This should write /run/sysconfig/bip based on configuration information such as in /etc/sysconfig/bip or /etc/defaults/bip. It is run once by bip-config.service. Distro specific path for bip_env.sh script must be set using a bip-config.service.d/distrib.conf unit file drop-in: [Service] ExecStart=/path/to/bip_env.sh bip_env.sh try some default paths for the default configuration file: either /etc/default/bip or /etc/sysconfig/bip. Optionaly, the default configuration file path can be set too: [Service] ExecStart=/path/to/bip_env.sh Environment=BIP_DEFAULT_CONFIG='/path/to/default/bip' bip-0.9.3/systemd/bip_env.sh0000775000175000017500000000240713242620630012672 00000000000000#!/bin/sh # Create /run/sysconfig/bip from default configuration file, for # bip-config.service # BIP_DEFAULT_CONFIG environment variable can be defined by packagers in a # drop-in override of bip-config.service unit if [ -n "${BIP_DEFAULT_CONFIG}" ]; then # try some default paths if [ -r /etc/default/bip ]; then BIP_DEFAULT_CONFIG=/etc/default/bip . "${BIP_DEFAULT_CONFIG}" elif [ -r /etc/sysconfig/bip ]; then BIP_DEFAULT_CONFIG=/etc/sysconfig/bip . "${BIP_DEFAULT_CONFIG}" fi else . "${BIP_DEFAULT_CONFIG}" fi ENABLED=${ENABLED:-1} mkdir -p /run/sysconfig { echo ENABLED=${ENABLED} DAEMON_HOME=${DAEMON_HOME:-/var/lib/bip} DAEMON_CONFIG=${DAEMON_CONFIG:-/etc/bip/bip.conf} echo "DAEMON_ARGS=${DAEMON_ARGS:--f '${DAEMON_CONFIG}' -s '${DAEMON_HOME}'}" } > /run/sysconfig/bip if [ ${ENABLED} = 0 ]; then echo "INFO: BIP is explicitely disabled (ENABLED == 0) in" \ "'${BIP_DEFAULT_CONFIG}'." else if [ -n "${DAEMON_USER}" -o -n "${DAEMON_GROUP}" ]; then echo "ERROR: Using systemd, DAEMON_USER and DAEMON_GROUP could not" \ "be defined using the default configuration file. A drop-in" \ "override of bip-config.service unit need to be created instead." exit 1 fi fi