bip-0.9.0-rc3/0000755000175000017500000000000013256270234007764 500000000000000bip-0.9.0-rc3/install-sh0000744000175000017500000003546313256270226011722 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bip-0.9.0-rc3/Makefile.am0000644000175000017500000000127413242620630011736 00000000000000bin_PROGRAMS = src/bip src/bipmkpw src_bip_SOURCES = src/conf.y src/lex.l \ src/bip.c src/bip.h \ src/connection.c src/connection.h \ src/defaults.h \ src/irc.c src/irc.h \ src/line.c src/line.h \ src/log.c src/log.h \ src/md5.c src/md5.h \ src/path_util.c src/path_util.h \ src/tuple.h \ src/util.c src/util.h src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c AM_YFLAGS= -d BUILT_SOURCES = src/conf.c src/conf.h src/lex.c AM_CFLAGS=-Wall -Wextra -Werror 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 bip-0.9.0-rc3/COPYING0000644000175000017500000004367212442320231010740 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.0-rc3/Makefile.in0000644000175000017500000010347213256270226011761 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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 = src/bip$(EXEEXT) src/bipmkpw$(EXEEXT) 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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(examplesdir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_src_bip_OBJECTS = src/conf.$(OBJEXT) src/lex.$(OBJEXT) \ src/bip.$(OBJEXT) src/connection.$(OBJEXT) src/irc.$(OBJEXT) \ src/line.$(OBJEXT) src/log.$(OBJEXT) src/md5.$(OBJEXT) \ src/path_util.$(OBJEXT) src/util.$(OBJEXT) src_bip_OBJECTS = $(am_src_bip_OBJECTS) src_bip_LDADD = $(LDADD) am_src_bipmkpw_OBJECTS = src/bipmkpw.$(OBJEXT) src/md5.$(OBJEXT) \ src/util.$(OBJEXT) src_bipmkpw_OBJECTS = $(am_src_bipmkpw_OBJECTS) src_bipmkpw_LDADD = $(LDADD) 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__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = @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 = $(src_bip_SOURCES) $(src_bipmkpw_SOURCES) DIST_SOURCES = $(src_bip_SOURCES) $(src_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__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 man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_examples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/src/config.h.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README TODO compile depcomp install-sh missing \ src/conf.c src/conf.h src/lex.c ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACC_EXISTS = @YACC_EXISTS@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_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@ src_bip_SOURCES = src/conf.y src/lex.l \ src/bip.c src/bip.h \ src/connection.c src/connection.h \ src/defaults.h \ src/irc.c src/irc.h \ src/line.c src/line.h \ src/log.c src/log.h \ src/md5.c src/md5.h \ src/path_util.c src/path_util.h \ src/tuple.h \ src/util.c src/util.h src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c AM_YFLAGS = -d BUILT_SOURCES = src/conf.c src/conf.h src/lex.c AM_CFLAGS = -Wall -Wextra -Werror 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y 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) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 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): src/config.h: src/stamp-h1 @test -f $@ || rm -f src/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/config.h src/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) src/conf.h: src/conf.c @if test ! -f $@; then rm -f src/conf.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/conf.c; else :; fi src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/conf.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/lex.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/bip.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/connection.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/irc.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/line.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/log.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/md5.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/path_util.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/util.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/bip$(EXEEXT): $(src_bip_OBJECTS) $(src_bip_DEPENDENCIES) $(EXTRA_src_bip_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/bip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(src_bip_OBJECTS) $(src_bip_LDADD) $(LIBS) src/bipmkpw.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/bipmkpw$(EXEEXT): $(src_bipmkpw_OBJECTS) $(src_bipmkpw_DEPENDENCIES) $(EXTRA_src_bipmkpw_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/bipmkpw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(src_bipmkpw_OBJECTS) $(src_bipmkpw_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bipmkpw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/connection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/irc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/path_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/util.Po@am__quote@ .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) '$<'` .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) 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) 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" 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-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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(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 -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(examplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(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 src/conf.c -rm -f src/conf.h -rm -f src/lex.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf src/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_examplesDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 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 $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf src/$(DEPDIR) -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 uninstall-dist_examplesDATA \ uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-cscope clean-generic cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-dist_examplesDATA \ uninstall-man uninstall-man1 uninstall-man5 .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.0-rc3/configure0000744000175000017500000064400613256270225011623 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Bip Sexy IRC Proxy 0.9.0-rc3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: 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_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Bip Sexy IRC Proxy' PACKAGE_TARNAME='bip' PACKAGE_VERSION='0.9.0-rc3' PACKAGE_STRING='Bip Sexy IRC Proxy 0.9.0-rc3' PACKAGE_BUGREPORT='http://bip.milkypond.org/projects/bip/activity' PACKAGE_URL='http://bip.milkypond.org/' ac_unique_file="src/bip.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS OIDENTD_FALSE OIDENTD_TRUE DEBUG_FALSE DEBUG_TRUE LIBOBJS ALLOCA EGREP GREP CPP YACC_EXISTS YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_debug with_openssl enable_oidentd enable_pie ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Bip Sexy IRC Proxy 0.9.0-rc3 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 Sexy IRC Proxy 0.9.0-rc3:";; 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 --enable-debug Enable debug build --enable-oidentd Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!) --disable-pie Do not build a position independent executable Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-openssl Disable SSL using OpenSSL 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. CPP C preprocessor 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 Sexy 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Bip Sexy IRC Proxy configure 0.9.0-rc3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------------------- ## ## Report this to http://bip.milkypond.org/projects/bip/activity ## ## ------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t 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 Sexy IRC Proxy $as_me 0.9.0-rc3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " alarm" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='bip' VERSION='0.9.0-rc3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # AC_PROG_YACC falls back to YACC = "yacc" if bison or byacc are not found, # but it does not mean it is present if test x"$YACC" = "xyacc"; then : # Extract the first word of "yacc", so it can be a program name with args. set dummy yacc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC_EXISTS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC_EXISTS"; then ac_cv_prog_YACC_EXISTS="$YACC_EXISTS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC_EXISTS="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_YACC_EXISTS" && ac_cv_prog_YACC_EXISTS="no" fi fi YACC_EXISTS=$ac_cv_prog_YACC_EXISTS if test -n "$YACC_EXISTS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC_EXISTS" >&5 $as_echo "$YACC_EXISTS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$YACC_EXISTS" != xyes; then : YACC=${am_missing_run}yacc fi fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in arpa/inet.h fcntl.h inttypes.h libintl.h limits.h malloc.h \ netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \ sys/socket.h sys/time.h termios.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5 $as_echo_n "checking for __attribute__... " >&6; } if ${ax_cv___attribute__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void foo(void) __attribute__ ((unused)); static void foo(void) { exit(1); } int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv___attribute__=yes else ax_cv___attribute__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv___attribute__" >&5 $as_echo "$ax_cv___attribute__" >&6; } if test "$ax_cv___attribute__" = "yes"; then $as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h fi # Checks for library functions. for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in $ac_func_list do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } if ${ac_cv_func_working_mktime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static const char *tz_strings[] = { (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (;;) { t = (time_t_max << 1) + 1; if (t <= time_t_max) break; time_t_max = t; } time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; ; j <<= 1) if (! bigtime_test (j)) return 1; else if (INT_MAX / 2 < j) break; if (! bigtime_test (INT_MAX)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else ac_cv_func_working_mktime=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_func in clock_gettime ftruncate gethostname gettimeofday localtime_r memmove do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in memset mkdir select socket strcasecmp strchr strcspn strdup strerror do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strrchr strstr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Deal with parameters # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; fi # Check whether --enable-oidentd was given. if test "${enable_oidentd+set}" = set; then : enableval=$enable_oidentd; fi # Check whether --enable-pie was given. if test "${enable_pie+set}" = set; then : enableval=$enable_pie; fi if test x$enable_debug = xyes; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi if test "x$enable_debug" = "xyes"; then : 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 : $as_echo "#define HAVE_BACKTRACE /**/" >>confdefs.h LDFLAGS="-rdynamic $LDFLAGS" backtrace="(with backtrace)" fi else enable_debug=no fi if test x$enable_identd = xyes; then OIDENTD_TRUE= OIDENTD_FALSE='#' else OIDENTD_TRUE='#' OIDENTD_FALSE= fi if test "x$enable_oidentd" = "xyes"; then : $as_echo "#define HAVE_OIDENTD /**/" >>confdefs.h else enable_oidentd=no fi if test "x$with_openssl" != "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto -lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char CRYPTO_new_ex_data (); int main () { return CRYPTO_new_ex_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_new_ex_data=yes else ac_cv_lib_crypto_CRYPTO_new_ex_data=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "library 'crypto' is required for OpenSSL support" "$LINENO" 5 with_openssl=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_read in -lssl" >&5 $as_echo_n "checking for SSL_read in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_read+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl -lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SSL_read (); int main () { return SSL_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_read=yes else ac_cv_lib_ssl_SSL_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_read" >&5 $as_echo "$ac_cv_lib_ssl_SSL_read" >&6; } if test "x$ac_cv_lib_ssl_SSL_read" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else as_fn_error $? "library 'ssl' is required for OpenSSL support" "$LINENO" 5 with_openssl=no fi else with_openssl=no fi if test "x$enable_pie" != "xno"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts PIE flags" >&5 $as_echo_n "checking whether $CC accepts PIE flags... " >&6; } if ${ap_cv_cc_pie+:} false; then : $as_echo_n "(cached) " >&6 else save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" if test "$cross_compiling" = yes; then : ap_cv_cc_pie=yes else 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ap_cv_cc_pie" >&5 $as_echo "$ap_cv_cc_pie" >&6; } if test "$ap_cv_cc_pie" = "yes"; then CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" enable_pie=yes fi fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -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 "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OIDENTD_TRUE}" && test -z "${OIDENTD_FALSE}"; then as_fn_error $? "conditional \"OIDENTD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Bip Sexy IRC Proxy $as_me 0.9.0-rc3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . Bip Sexy IRC Proxy home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Bip Sexy IRC Proxy config.status 0.9.0-rc3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _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" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test "x$with_openssl" != "xno"; then : echo OPENSSL: yes fi echo DEBUG: $enable_debug $backtrace echo OIDENTD: $enable_oidentd echo PIE: $enable_pie bip-0.9.0-rc3/configure.ac0000644000175000017500000000715313256270222012175 00000000000000AC_PREREQ([2.69]) AC_INIT([Bip Sexy IRC Proxy], [0.9.0-rc3], [http://bip.milkypond.org/projects/bip/activity], [bip], [http://bip.milkypond.org/]) AM_INIT_AUTOMAKE([subdir-objects]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_CONFIG_SRCDIR([src/bip.h]) AC_CONFIG_HEADERS([src/config.h]) # Checks for programs AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL AM_PROG_LEX AC_PROG_YACC # AC_PROG_YACC falls back to YACC = "yacc" if bison or byacc are not found, # but it does not mean it is present AS_IF([test x"$YACC" = "xyacc"], [ AC_CHECK_PROG([YACC_EXISTS], [yacc], [yes], [no]) AS_IF([test x"$YACC_EXISTS" != xyes], [ YACC=${am_missing_run}yacc ]) ]) # Checks for header files. AC_FUNC_ALLOCA AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h malloc.h \ netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h \ sys/socket.h sys/time.h termios.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT8_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T AX_C___ATTRIBUTE__ AH_BOTTOM([ /* Unused attributes such as function parameters (GCC extension) */ #ifdef HAVE___ATTRIBUTE__ # define UNUSED(ATTRIBUTE) ATTRIBUTE __attribute__((unused)) #else # define UNUSED(ATTRIBUTE) ATTRIBUTE #endif]) # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MKTIME AC_FUNC_REALLOC AC_CHECK_FUNCS(clock_gettime ftruncate gethostname gettimeofday localtime_r memmove) AC_CHECK_FUNCS(memset mkdir select socket strcasecmp strchr strcspn strdup strerror) AC_CHECK_FUNCS(strrchr strstr) # Deal with parameters AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug build])) AC_ARG_WITH([openssl], AS_HELP_STRING([--without-openssl], [Disable SSL using OpenSSL])) AC_ARG_ENABLE([oidentd], AS_HELP_STRING([--enable-oidentd], [Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)])) AC_ARG_ENABLE([pie], AS_HELP_STRING([--disable-pie], [Do not build a position independent executable])) AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes) AS_IF([test "x$enable_debug" = "xyes"], [ AC_CHECK_FUNC(backtrace_symbols_fd, [ AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()]) LDFLAGS="-rdynamic $LDFLAGS" backtrace="(with backtrace)" ]) ], [ enable_debug=no ]) AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes) AS_IF([test "x$enable_oidentd" = "xyes"], [ AC_DEFINE([HAVE_OIDENTD], [], [Have bip edit ~/.oidentd.conf]) ], [ enable_oidentd=no ]) AS_IF([test "x$with_openssl" != "xno"], [ AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [ AC_MSG_ERROR([library 'crypto' is required for OpenSSL support]) with_openssl=no ], -lcrypto) AC_CHECK_LIB(ssl, SSL_read, [], [ AC_MSG_ERROR([library 'ssl' is required for OpenSSL support]) with_openssl=no ], -lssl) ], [ with_openssl=no ]) AS_IF([test "x$enable_pie" != "xno"], [ 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 ]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT AS_IF([test "x$with_openssl" != "xno"], [ echo OPENSSL: yes ]) echo DEBUG: $enable_debug $backtrace echo OIDENTD: $enable_oidentd echo PIE: $enable_pie bip-0.9.0-rc3/ylwrap0000744000175000017500000001531313256270226011152 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2016-01-11.22; # UTC # Copyright (C) 1996-2017 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 'write-file-hooks '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.0-rc3/missing0000744000175000017500000001533013256270226011304 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bip-0.9.0-rc3/aclocal.m40000644000175000017500000013351613256270225011555 00000000000000# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html # =========================================================================== # # SYNOPSIS # # AX_C___ATTRIBUTE__ # # DESCRIPTION # # Provides a test for the compiler support of __attribute__ extensions. # Defines HAVE___ATTRIBUTE__ if it is found. # # LICENSE # # Copyright (c) 2008 Stepan Kasal # Copyright (c) 2008 Christian Haggstrom # Copyright (c) 2008 Ryan McCabe # # 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 9 AC_DEFUN([AX_C___ATTRIBUTE__], [ AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include static void foo(void) __attribute__ ((unused)); static void foo(void) { exit(1); } ]], [])], [ax_cv___attribute__=yes], [ax_cv___attribute__=no] ) ]) if test "$ax_cv___attribute__" = "yes"; then AC_DEFINE([HAVE___ATTRIBUTE__], 1, [define if your compiler has __attribute__]) fi ]) # Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 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-2017 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-2017 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-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 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-2017 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-2017 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-2017 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-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 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-2017 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-2017 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-2017 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-2017 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-2017 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-2017 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-2017 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.0-rc3/depcomp0000744000175000017500000005601713256270226011271 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bip-0.9.0-rc3/ChangeLog0000644000175000017500000033630713256270222011467 00000000000000commit eaed46da1485ea81556ad255d7d56dc33daf1913 (G) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:38 2018 +0100 Merge branch 'path_test_use_stat' commit 025689d8074b13f5229ee99b95190437194bae53 (G) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:23 2018 +0100 Merge branch 'dh_param_not_mandatory' commit 948b41ef7a09b751df22bbd1c8f28b7bbe405a18 (G) Author: Pierre-Louis Bonicoli Date: Thu Mar 22 02:37:10 2018 +0100 Merge branch 'fix_path_construction_issue' commit 7834471f78c1af516df4bdbc193a805582e9f7fa (G) 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 (G) 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 (G) 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 (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:26:34 2018 +0100 Add -git to version string. commit 8ceebf1fd882f855d46a3d1d45dddbf50a357111 (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:09:25 2018 +0100 Merge branch 'username_disallow_duplicate' commit 96f0403a2ab2f5df63b4e1f584a1bd9879be1339 (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 20:07:38 2018 +0100 Add missing call to MAYFREE commit dbe19d938775121e8557068fd3254894f2178684 (G) Author: Pierre-Louis Bonicoli Date: Wed Mar 1 14:14:35 2017 +0100 Handle no defined users commit 903a88e58977cde81b894d106354bbd74fc26a99 (G) Author: Pierre-Louis Bonicoli Date: Mon Feb 19 19:59:06 2018 +0100 Merge branch 'systemd' commit 866552e102d4918735daa9c48eaef764ca201799 (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:23:21 2017 +0100 sample conf: reformat commit 6d3bff19693047e752b9e649a03946402d6bfdf8 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:22:53 2017 +0100 sample conf: remove trailing spaces commit 97e19a52158ae25352fa84b4b5f29379904aa088 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:21:52 2017 +0100 sample conf: comment the whole file commit a31cbe45fabc4970faef2522e63ad24e619150ad (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:17:34 2017 +0100 bipmkpw man page: mention bip man page commit 072a17b55b61ef95148fdcd4ab467038b88d74fd (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:10:03 2017 +0100 bip.conf manpage: mention default of ciphers related options commit 3b9f683d31c8ba928df636c554e5cafc0c12cdec (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:08:03 2017 +0100 bip.conf manpage: fix doc of 'ip' option commit 09152a1a7d479e0c76c9ae2fea75ddeb9bb0f0ff (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:07:07 2017 +0100 bip.conf manpage: new section 'IRC CLIENT CONF' commit 11482caa95fafe5201107060ac334ad6b03f4275 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:02:25 2017 +0100 bip.conf manpage: add a SYNOPSIS section commit b474f55e8ae7c57ee4dbfe71f1b64dc8e42139e5 (G) Author: Pierre-Louis Bonicoli Date: Tue Feb 28 16:00:49 2017 +0100 bip manpage: mention -s switch in SYNOPSIS section commit af46159275c3e533a4c02326ffa80a673a4bcdc3 (G) Author: Pierre-Louis Bonicoli Date: Thu Feb 23 16:56:17 2017 +0100 Sample config file: add default values commit e52df8d08615f55d58011a720aadaecd1769a104 (G) Author: Pierre-Louis Bonicoli Date: Wed Feb 15 16:41:59 2017 +0100 sample.conf: use /run instead of /var/run commit 3f4a260a54b6bf8812310c3d3c320d559b8c0374 (G) 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 (G) Author: Pierre-Louis Bonicoli Date: Wed Jul 26 03:41:10 2017 +0200 Sign commits created by release script commit 2ecd82f0112e6d57e8651296d624975aa56e03a4 (G) 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.0-rc3/BUGS0000644000175000017500000000005212442320231010351 00000000000000- make install fails to install examples. bip-0.9.0-rc3/TODO0000644000175000017500000000276313051303063010372 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.0-rc3/AUTHORS0000644000175000017500000000046612442320231010747 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. bip-0.9.0-rc3/src/0000755000175000017500000000000013256270234010553 500000000000000bip-0.9.0-rc3/src/md5.h0000644000175000017500000000057512442320231011325 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.0-rc3/src/config.h.in0000644000175000017500000001736513256270225012532 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Use glibc backtrace on fatal() */ #undef HAVE_BACKTRACE /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Have bip edit ~/.oidentd.conf */ #undef HAVE_OIDENTD /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* define if your compiler has __attribute__ */ #undef HAVE___ATTRIBUTE__ /* 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 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ #undef vfork /* Unused attributes such as function parameters (GCC extension) */ #ifdef HAVE___ATTRIBUTE__ # define UNUSED(ATTRIBUTE) ATTRIBUTE __attribute__((unused)) #else # define UNUSED(ATTRIBUTE) ATTRIBUTE #endif bip-0.9.0-rc3/src/util.c0000644000175000017500000003423312737402351011621 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 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. */ #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; extern int errno; extern FILE *conf_global_log_file; void memory_fatal(void) { fflush(conf_global_log_file); #define OOMMSG "Out of memory.\n" fwrite(OOMMSG, 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; } char *bip_strdup(const char *str) { char *r = strdup(str); if (!r) memory_fatal(); return r; } /* * ::= { | | } * ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}' */ 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); snprintf(ts, 20, "%02d-%02d-%04d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec); return ts; } char *hrtime(time_t s) { static char ts[20]; struct tm *tm; if (s == 0) return "never"; tm = localtime(&s); snprintf(ts, 20, "%02d-%02d-%04d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec); 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 print_trace(void) { void *array[32]; size_t 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 print_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 */ while ((c = *pkey++)) hash = ((hash << 5) + hash) ^ 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 = toupper(*s); 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 *) * (index + 1)); memset(a->elemv + a->elemc, 0, sizeof(void *) * (index + 1 - a->elemc)); a->elemc = index + 1; } void *array_drop(array_t *a, int index) { int i; 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.0-rc3/src/connection.h0000644000175000017500000000554413051303063013001 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 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 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; unsigned 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, int 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, int *msec, int *nc); int cn_is_connected(connection_t *cn); int cn_is_listening(connection_t *cn); int connection_localport(connection_t *cn); int connection_remoteport(connection_t *cn); char *connection_localip(connection_t *cn); char *connection_remoteip(connection_t *cn); #endif bip-0.9.0-rc3/src/lex.c0000644000175000017500000020203313256270234011427 00000000000000 #line 3 "src/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 68 #define YY_END_OF_BUFFER 69 /* 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[494] = { 0, 0, 0, 69, 67, 1, 2, 67, 67, 4, 66, 63, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 64, 65, 1, 0, 62, 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, 30, 46, 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, 11, 0, 0, 12, 0, 16, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 5, 13, 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, 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, 9, 0, 0, 0, 0, 0, 0, 0, 38, 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, 34, 0, 0, 0, 0, 0, 23, 54, 17, 0, 0, 0, 0, 0, 0, 0, 51, 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, 15, 0, 0, 0, 0, 0, 0, 35, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 19, 0, 0, 0, 0, 55, 0, 61, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 39, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 8, 0, 0, 0, 0, 0, 52, 26, 0, 0, 31, 40, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 58, 0, 57, 60, 27, 28, 37, 0, 0, 59, 0, 41, 0, 0, 42, 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[496] = { 0, 0, 0, 505, 506, 34, 506, 499, 500, 495, 506, 506, 23, 28, 24, 486, 29, 475, 31, 484, 473, 41, 39, 40, 482, 46, 469, 467, 476, 506, 506, 60, 488, 506, 489, 506, 484, 467, 457, 459, 476, 473, 459, 57, 473, 457, 463, 457, 464, 457, 456, 449, 452, 506, 442, 457, 450, 443, 458, 460, 455, 458, 439, 452, 438, 57, 437, 433, 440, 431, 445, 434, 439, 446, 431, 422, 433, 443, 429, 436, 426, 431, 433, 423, 435, 417, 422, 414, 417, 506, 431, 425, 407, 417, 424, 421, 422, 406, 423, 403, 409, 405, 398, 401, 417, 411, 398, 396, 399, 389, 401, 410, 397, 388, 389, 388, 391, 399, 389, 397, 381, 395, 384, 506, 381, 53, 506, 382, 506, 384, 381, 379, 371, 386, 506, 377, 376, 384, 385, 59, 506, 506, 368, 506, 368, 370, 370, 368, 364, 374, 375, 374, 361, 358, 373, 363, 352, 368, 357, 366, 355, 346, 351, 358, 347, 351, 349, 354, 361, 347, 343, 354, 60, 353, 506, 357, 347, 346, 347, 348, 352, 332, 338, 331, 348, 328, 327, 345, 344, 326, 321, 326, 55, 329, 334, 334, 323, 319, 323, 321, 333, 506, 332, 326, 321, 323, 326, 313, 323, 325, 324, 308, 322, 506, 506, 303, 311, 319, 304, 60, 304, 311, 296, 311, 294, 506, 298, 311, 305, 305, 303, 302, 287, 289, 301, 298, 301, 300, 300, 288, 74, 284, 283, 281, 286, 279, 62, 284, 283, 286, 289, 277, 506, 288, 282, 267, 279, 281, 506, 506, 506, 274, 267, 270, 266, 259, 275, 262, 506, 264, 266, 256, 258, 267, 256, 258, 255, 264, 253, 257, 260, 246, 260, 245, 244, 241, 506, 250, 245, 257, 247, 236, 241, 236, 252, 232, 238, 238, 234, 225, 232, 238, 244, 225, 223, 218, 240, 234, 506, 235, 236, 231, 224, 216, 212, 506, 218, 506, 230, 218, 229, 223, 208, 67, 226, 206, 212, 223, 221, 216, 220, 200, 213, 208, 506, 197, 215, 203, 201, 195, 506, 192, 205, 190, 186, 202, 188, 188, 506, 189, 184, 199, 201, 185, 188, 175, 179, 181, 186, 175, 190, 191, 80, 506, 177, 506, 190, 172, 183, 186, 506, 181, 506, 181, 169, 178, 179, 174, 171, 161, 506, 164, 164, 176, 170, 162, 164, 164, 153, 169, 155, 168, 150, 143, 151, 159, 146, 145, 152, 506, 157, 506, 147, 153, 74, 506, 146, 140, 155, 142, 140, 143, 148, 129, 149, 144, 506, 142, 127, 129, 133, 120, 124, 126, 126, 506, 131, 122, 137, 131, 132, 133, 132, 119, 506, 506, 125, 122, 506, 506, 110, 114, 127, 121, 124, 108, 506, 112, 106, 109, 102, 110, 113, 116, 102, 96, 97, 96, 107, 506, 110, 506, 103, 97, 91, 94, 101, 104, 86, 102, 89, 99, 506, 95, 81, 81, 93, 83, 506, 81, 506, 506, 506, 506, 506, 74, 81, 506, 81, 506, 66, 53, 506, 506, 43, 40 } ; static const flex_int16_t yy_def[496] = { 0, 493, 1, 493, 493, 493, 493, 494, 495, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 494, 493, 495, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 0, 493, 493 } ; static const flex_int16_t yy_nxt[542] = { 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, 4, 4, 29, 30, 31, 37, 31, 41, 49, 34, 44, 45, 32, 38, 46, 42, 52, 47, 43, 62, 56, 39, 50, 40, 57, 53, 60, 63, 58, 66, 31, 61, 31, 64, 59, 78, 100, 158, 101, 67, 172, 173, 68, 159, 248, 492, 203, 223, 160, 161, 204, 224, 79, 269, 279, 423, 249, 280, 349, 491, 281, 386, 387, 350, 270, 271, 272, 424, 490, 273, 489, 488, 487, 486, 485, 484, 388, 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, 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, 430, 429, 428, 427, 426, 425, 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, 385, 384, 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, 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, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, 278, 277, 276, 275, 274, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 157, 156, 140, 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, 104, 103, 102, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 77, 76, 75, 74, 73, 72, 36, 35, 33, 71, 70, 69, 65, 55, 54, 51, 48, 36, 35, 33, 493, 3, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493 } ; static const flex_int16_t yy_chk[542] = { 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, 495, 14, 14, 494, 12, 14, 13, 18, 14, 13, 23, 21, 12, 16, 12, 21, 18, 22, 23, 21, 25, 31, 22, 31, 23, 21, 43, 65, 125, 65, 25, 139, 139, 25, 125, 219, 491, 172, 192, 125, 125, 172, 192, 43, 240, 246, 404, 219, 246, 323, 490, 246, 362, 362, 323, 240, 240, 240, 404, 488, 240, 486, 485, 479, 477, 476, 475, 362, 474, 473, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 460, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 445, 444, 443, 442, 441, 440, 437, 436, 433, 432, 431, 430, 429, 428, 427, 426, 424, 423, 422, 421, 420, 419, 418, 417, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 403, 402, 400, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, 378, 377, 376, 375, 374, 373, 371, 369, 368, 367, 366, 364, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 347, 346, 345, 344, 343, 342, 341, 339, 338, 337, 336, 335, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 322, 321, 320, 319, 318, 316, 314, 313, 312, 311, 310, 309, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 267, 266, 265, 264, 263, 262, 261, 257, 256, 255, 254, 253, 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 224, 223, 222, 221, 220, 218, 217, 216, 215, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 200, 199, 198, 197, 196, 195, 194, 193, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 173, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 142, 138, 137, 136, 135, 133, 132, 131, 130, 129, 127, 124, 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, 92, 91, 90, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 46, 45, 44, 42, 41, 40, 39, 38, 37, 36, 34, 32, 28, 27, 26, 24, 20, 19, 17, 15, 9, 8, 7, 3, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493 } ; 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 "src/lex.l" #define YY_NO_INPUT 1 #line 3 "src/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 * * 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 771 "src/lex.c" #line 772 "src/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 49 "src/lex.l" #line 989 "src/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 >= 494 ) 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] != 506 ); 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 50 "src/lex.l" YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 51 "src/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 52 "src/lex.l" YY_BREAK case 4: YY_RULE_SETUP #line 53 "src/lex.l" { yylval.number = atoi(yytext); return LEX_INT; } YY_BREAK case 5: YY_RULE_SETUP #line 57 "src/lex.l" { yylval.number = strcmp(yytext, "true") == 0 ? 1 : 0; return LEX_BOOL; } YY_BREAK case 6: YY_RULE_SETUP #line 62 "src/lex.l" { return LEX_IP; } YY_BREAK case 7: YY_RULE_SETUP #line 63 "src/lex.l" { return LEX_PORT; } YY_BREAK case 8: YY_RULE_SETUP #line 64 "src/lex.l" { return LEX_CSS; } YY_BREAK case 9: YY_RULE_SETUP #line 65 "src/lex.l" { return LEX_SERVER; } YY_BREAK case 10: YY_RULE_SETUP #line 66 "src/lex.l" { return LEX_NETWORK; } YY_BREAK case 11: YY_RULE_SETUP #line 67 "src/lex.l" { return LEX_HOST; } YY_BREAK case 12: YY_RULE_SETUP #line 68 "src/lex.l" { return LEX_NAME; } YY_BREAK case 13: YY_RULE_SETUP #line 69 "src/lex.l" { return LEX_USER; } YY_BREAK case 14: YY_RULE_SETUP #line 70 "src/lex.l" { return LEX_ADMIN; } YY_BREAK case 15: YY_RULE_SETUP #line 71 "src/lex.l" { return LEX_CONNECTION; } YY_BREAK case 16: YY_RULE_SETUP #line 72 "src/lex.l" { return LEX_NICK; } YY_BREAK case 17: YY_RULE_SETUP #line 73 "src/lex.l" { return LEX_REALNAME; } YY_BREAK case 18: YY_RULE_SETUP #line 74 "src/lex.l" { return LEX_DEFAULT_NICK; } YY_BREAK case 19: YY_RULE_SETUP #line 75 "src/lex.l" { return LEX_DEFAULT_USER; } YY_BREAK case 20: YY_RULE_SETUP #line 76 "src/lex.l" { return LEX_DEFAULT_REALNAME; } YY_BREAK case 21: YY_RULE_SETUP #line 77 "src/lex.l" { return LEX_SOURCE_PORT; } YY_BREAK case 22: YY_RULE_SETUP #line 78 "src/lex.l" { return LEX_VHOST; } YY_BREAK case 23: YY_RULE_SETUP #line 79 "src/lex.l" { return LEX_PASSWORD; } YY_BREAK case 24: YY_RULE_SETUP #line 80 "src/lex.l" { return LEX_SSL; } YY_BREAK case 25: YY_RULE_SETUP #line 81 "src/lex.l" { return LEX_SSL_CHECK_MODE; } YY_BREAK case 26: YY_RULE_SETUP #line 82 "src/lex.l" { return LEX_SSL_CHECK_STORE; } YY_BREAK case 27: YY_RULE_SETUP #line 83 "src/lex.l" { return LEX_SSL_CLIENT_CERTFILE; } YY_BREAK case 28: YY_RULE_SETUP #line 84 "src/lex.l" { return LEX_DEFAULT_CIPHERS; } YY_BREAK case 29: YY_RULE_SETUP #line 85 "src/lex.l" { return LEX_CIPHERS; } YY_BREAK case 30: YY_RULE_SETUP #line 86 "src/lex.l" { return LEX_KEY; } YY_BREAK case 31: YY_RULE_SETUP #line 87 "src/lex.l" { return LEX_AUTOJOIN_ON_KICK; } YY_BREAK case 32: YY_RULE_SETUP #line 88 "src/lex.l" { return LEX_CHANNEL; } YY_BREAK case 33: YY_RULE_SETUP #line 89 "src/lex.l" { return LEX_LOG_LEVEL; } YY_BREAK case 34: YY_RULE_SETUP #line 90 "src/lex.l" { return LEX_LOG_ROOT; } YY_BREAK case 35: YY_RULE_SETUP #line 91 "src/lex.l" { return LEX_LOG_FORMAT; } YY_BREAK case 36: YY_RULE_SETUP #line 92 "src/lex.l" { return LEX_BACKLOG_LINES; } YY_BREAK case 37: YY_RULE_SETUP #line 93 "src/lex.l" { return LEX_BACKLOG_NO_TIMESTAMP; } YY_BREAK case 38: YY_RULE_SETUP #line 94 "src/lex.l" { return LEX_BACKLOG; } YY_BREAK case 39: YY_RULE_SETUP #line 95 "src/lex.l" { return LEX_ALWAYS_BACKLOG; } YY_BREAK case 40: YY_RULE_SETUP #line 96 "src/lex.l" { return LEX_BL_MSG_ONLY; } YY_BREAK case 41: YY_RULE_SETUP #line 97 "src/lex.l" { return LEX_BLRESET_ON_TALK; } YY_BREAK case 42: YY_RULE_SETUP #line 98 "src/lex.l" { return LEX_BLRESET_CONNECTION; } YY_BREAK case 43: YY_RULE_SETUP #line 99 "src/lex.l" { return LEX_BLRESET_ON_TALK; } YY_BREAK case 44: YY_RULE_SETUP #line 100 "src/lex.l" { return LEX_BL_MSG_ONLY; } YY_BREAK case 45: YY_RULE_SETUP #line 101 "src/lex.l" { return LEX_ALWAYS_BACKLOG; } YY_BREAK case 46: YY_RULE_SETUP #line 102 "src/lex.l" { return LEX_LOG; } YY_BREAK case 47: YY_RULE_SETUP #line 103 "src/lex.l" { return LEX_LOG_SYSTEM; } YY_BREAK case 48: YY_RULE_SETUP #line 104 "src/lex.l" { return LEX_LOG_SYNC_INTERVAL; } YY_BREAK case 49: YY_RULE_SETUP #line 105 "src/lex.l" { return LEX_FOLLOW_NICK; } YY_BREAK case 50: YY_RULE_SETUP #line 106 "src/lex.l" { return LEX_IGN_FIRST_NICK; } YY_BREAK case 51: YY_RULE_SETUP #line 107 "src/lex.l" { return LEX_AWAY_NICK; } YY_BREAK case 52: YY_RULE_SETUP #line 108 "src/lex.l" { return LEX_ON_CONNECT_SEND; } YY_BREAK case 53: YY_RULE_SETUP #line 109 "src/lex.l" { return LEX_NO_CLIENT_AWAY_MSG; } YY_BREAK case 54: YY_RULE_SETUP #line 110 "src/lex.l" { return LEX_PID_FILE; } YY_BREAK case 55: YY_RULE_SETUP #line 111 "src/lex.l" { return LEX_OIDENTD_FILE; } YY_BREAK case 56: YY_RULE_SETUP #line 112 "src/lex.l" { return LEX_BIP_USE_NOTICE; } YY_BREAK case 57: YY_RULE_SETUP #line 113 "src/lex.l" { return LEX_CSS_PEM; } YY_BREAK case 58: YY_RULE_SETUP #line 114 "src/lex.l" { return LEX_CSS_CIPHERS; } YY_BREAK case 59: YY_RULE_SETUP #line 115 "src/lex.l" { return LEX_DH_PARAM; } YY_BREAK case 60: YY_RULE_SETUP #line 116 "src/lex.l" { return LEX_IGNORE_CAPAB; } YY_BREAK case 61: YY_RULE_SETUP #line 117 "src/lex.l" { return LEX_RECONN_TIMER; } YY_BREAK case 62: /* rule 62 can match eol */ YY_RULE_SETUP #line 118 "src/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 63: YY_RULE_SETUP #line 125 "src/lex.l" { return LEX_EQ; } YY_BREAK case 64: YY_RULE_SETUP #line 126 "src/lex.l" { return LEX_LBRA; } YY_BREAK case 65: YY_RULE_SETUP #line 127 "src/lex.l" { return LEX_RBRA; } YY_BREAK case 66: YY_RULE_SETUP #line 128 "src/lex.l" { return LEX_SEMICOLON; } YY_BREAK case 67: YY_RULE_SETUP #line 129 "src/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 68: YY_RULE_SETUP #line 131 "src/lex.l" ECHO; YY_BREAK #line 1405 "src/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 >= 494 ) 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 >= 494 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 493); 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 131 "src/lex.l" bip-0.9.0-rc3/src/bipmkpw.c0000644000175000017500000000371012442320231012276 00000000000000/* * $Id$ * * 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. */ #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 readpass(char *buffer, int buflen) { int ttyfd = open("/dev/tty", O_RDWR); if (ttyfd == -1) { fprintf(stderr, "Unable to open tty: %s\n", strerror(errno)); exit(1); } struct termios tt, ttback; memset(&ttback, 0, sizeof(ttback)); if (tcgetattr(ttyfd, &ttback) < 0) { fprintf(stderr, "tcgetattr failed: %s\n", strerror(errno)); exit(1); } memcpy(&tt, &ttback, sizeof(ttback)); tt.c_lflag &= ~(ICANON|ECHO); if (tcsetattr(ttyfd, TCSANOW, &tt) < 0) { fprintf(stderr, "tcsetattr failed: %s\n", strerror(errno)); exit(1); } write(ttyfd, "Password: ", 10); int idx = 0; int valid = 1; while (idx < buflen) { read(ttyfd, buffer+idx, 1); if (buffer[idx] == '\n') { buffer[idx] = 0; break; } else if (buffer[idx] == ' ') { valid = 0; } idx++; } write(ttyfd, "\n", 1); 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; // the time used to type the pass is entropy srand(time(NULL)); seed = rand(); md5 = chash_double(str, seed); for (i = 0; i < 20; i++) printf("%02x", md5[i]); printf("\n"); free(md5); return 0; } bip-0.9.0-rc3/src/connection.c0000644000175000017500000012616613254604323013010 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 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. */ #include "config.h" #include #include #include "connection.h" #include "path_util.h" extern int errno; #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 ", (long)cn->handle); 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; size = sizeof(char)*strlen(message); 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, 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 != size) { /* abnormal : openssl keeps writing until message is not fully * sent */ mylog(LOG_DEBUG, "only %d written 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 += 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 */ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINPROGRESS) { 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 max, count; max = CONN_BUFFER_SIZE - cn->incoming_end; 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, sizeof(char) * 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; } cn->incoming_end += count; return 0; } #endif /* returns 1 if connection must be notified */ static int read_socket(connection_t *cn) { int max, count; if (cn == NULL) return 0; max = CONN_BUFFER_SIZE - cn->incoming_end; count = read(cn->handle, cn->incoming+cn->incoming_end, sizeof(char)*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; } cn->incoming_end += 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 (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 (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 (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)) { now = 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 += (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, int *msec, int *nc) { fd_set fds_read, fds_write, fds_except; int maxfd = -1, err, errtime; 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); errtime = clock_gettime(CLOCK_MONOTONIC, &btv); if (errtime != 0) { fatal("clock_gettime: %s", strerror(errno)); } 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); } errtime = clock_gettime(CLOCK_MONOTONIC, &etv); if (errtime != 0) { fatal("clock_gettime: %s", strerror(errno)); } 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, 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, int timeout, int listen) { connection_t *conn; char *incoming; list_t *outgoing; conn = (connection_t *)bip_calloc(sizeof(connection_t), 1); incoming = (char *)bip_malloc(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; int 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; } ret = SSL_CTX_set_tmp_dh(ctx, dh); 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, 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, 0, 1); create_listening_socket(hostname, portbuf, conn); return conn; } static connection_t *_connection_new(char *dsthostname, char *dstport, char *srchostname, char *srcport, int 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, ret, rng; char buf[1025]; SSL_CTX *ctx; if (!ssl_initialized) { SSL_library_init(); SSL_load_error_strings(); errbio = BIO_new_fp(conf_global_log_file, BIO_NOCLOSE); ssl_cx_idx = SSL_get_ex_new_index(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, 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, 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; } SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH); SSL_CTX_set_timeout(ctx, (long)60); SSL_CTX_set_options(ctx, SSL_OP_ALL); 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(err), err); } return result; } static int SSLize(connection_t *cn, int *nc) { int err, err2; 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]; int 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, "Negociated 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((err = SSL_get_verify_result(cn->ssl_h)) != X509_V_OK) { mylog(LOG_ERROR, "Certificate check failed: %s (%d)!", X509_verify_cert_error_string(err), err); cn->connected = CONN_UNTRUSTED; return 1; } break; case SSL_CHECK_CA: if((err = SSL_get_verify_result(cn->ssl_h)) != X509_V_OK) { mylog(LOG_ERROR, "Certificate check failed: %s (%d)!", X509_verify_cert_error_string(err), err); cn->connected = CONN_UNTRUSTED; return 1; } break; } if (err2 == SSL_ERROR_SYSCALL) { /* socked died */ 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, int 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_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; } 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, int 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, 20, "%d", dstport) >= 20) dstportbuf[19] = '\0'; if (srcport) { if (snprintf(srcportbuf, 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, 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 int connection_localport(connection_t *cn) { struct sockaddr_in addr; int err; socklen_t addrlen; if (cn->handle <= 0) return -1; 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 -1; } return ntohs(addr.sin_port); } int connection_remoteport(connection_t *cn) { struct sockaddr_in addr; int err; socklen_t addrlen; if (cn->handle <= 0) return -1; 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 -1; } return ntohs(addr.sin_port); } 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(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.0-rc3/src/bip.h0000644000175000017500000000146212442320231011406 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.0-rc3/src/md5.c0000644000175000017500000002376412442320231011325 00000000000000/* * RFC 1321 compliant MD5 implementation * * Copyright (C) 2001-2003 Christophe Devine * * 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, 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); ptr[0] = seed >> 24 & 0xff; ptr[1] = seed >> 16 & 0xff; ptr[2] = seed >> 8 & 0xff; ptr[3] = seed & 0xff; memcpy(ptr + 4, str, length - 4); md5 = bip_malloc(16 + 4); memcpy(md5, ptr, 4); md5_starts(&ctx); md5_update(&ctx, ptr, length); md5_finish(&ctx, md5 + 4); md5_starts(&ctx); md5_update(&ctx, md5, 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.0-rc3/src/log.c0000644000175000017500000007560513242620630011427 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 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. */ #define _XOPEN_SOURCE 500 #include "config.h" #include "log.h" #include "irc.h" #include "util.h" #include #include extern int errno; 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 int _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) { int pos, count = 0; char *dir, *tmp; int len = strlen(dirname); 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, "/", 1); 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 = tolower(*c); } /* * 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; unsigned int lenvar = strlen(var); unsigned int 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(MAX_PATH_LEN + 1); time(&s); now = localtime(&s); snprintf(year, 5, "%04d", now->tm_year + 1900); snprintf(day, 3, "%02d", now->tm_mday); snprintf(month, 3, "%02d", now->tm_mon + 1); snprintf(hour, 3, "%02d", now->tm_hour); snprintf(logfile, 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; 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); } assert(olf); assert(olf->file); list_it_init_last(&store->file_group, &store->file_it); fseek(olf->file, 0, SEEK_END); olf->len = ftell(olf->file); store->file_offset = olf->len; } void log_reinit(logstore_t *store) { mylog(LOG_ERROR, "%s is inconsistant, 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; 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, 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; lf->len = ftell(f); 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), 1); list_init(&store->file_group, NULL); store->name = bip_strdup(destination); store->skip_advance = 0; if (lf) store->file_offset = 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, 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, LOGLINE_MAXLEN, "%s -!- %s has left %s [%s]", timestamp(), ircmask, channel, message); else snprintf(logdata->buffer, 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, 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, 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, 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 ", 8) != 0) return; msg = bip_strdup(real_message); *(msg + strlen(msg) - 1) = '\0'; snprintf(logdata->buffer, LOGLINE_MAXLEN, "%s %c * %s %s", timestamp(), dir, from, msg + 8); free(msg); } else { snprintf(logdata->buffer, 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) { 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); } } 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; 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); } } 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, 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, 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(50 + 1); timestr[0] = '\0'; if (time) strftime(timestr, 50, "%A %d %B %Y, %H:%M:%S", time); timestr[50] = '\0'; snprintf(logdata->buffer, 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(LOGLINE_MAXLEN + 1); char *tmpbuf2 = bip_malloc(LOGLINE_MAXLEN + 1); char *tmp; snprintf(tmpbuf, LOGLINE_MAXLEN, "%s -!- mode/%s [%s", timestamp(), channel, modes); if (mode_args) { for (i = 0; i < array_count(mode_args); i++) { snprintf(tmpbuf2, LOGLINE_MAXLEN, "%s %s", tmpbuf, (char *)array_get(mode_args, i)); tmp = tmpbuf; tmpbuf = tmpbuf2; tmpbuf2 = tmp; } } snprintf(logdata->buffer, 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, 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, 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, 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); if (ischannel(*hash_it_key(&hi))) log_reset(store); else list_add_last(&drop, strdup(hash_it_key(&hi))); } 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); if (!ischannel(*storename)) log_drop(log, storename); } } 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; return 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, ' '); if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); p++; sots = p; p = strchr(p, ' '); if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); lots = p - sots; p++; if (strncmp(p, "-!-", 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 = p - son; p = strchr(p, ' '); if (!p || !p[0] || !p[1]) return _log_wrap(dest, buf); p++; if (out && !ischannel(*dest)) { son = storename; lon = strlen(storename); } som = p; lom = strlen(p); if (lom == 0) return _log_wrap(dest, buf); p = ret = (char *)bip_malloc( 1 + lon + strlen(LAMESTRING) + strlen(dest) + 2 + lots + 2 + lom + 3 + action * (2 + strlen("ACTION ")) + 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 "); } if (out && !ischannel(*dest)) { strcpy(p, PMSG_ARROW); p += strlen(PMSG_ARROW); } if (logdata->user->backlog_no_timestamp == 0) { 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, 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(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; } int slen = strlen(buf); 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; size_t count; buf = bip_malloc(LOGLINE_MAXLEN + 1); count = snprintf(buf, LOGLINE_MAXLEN + 1, ":" P_IRCMASK " PRIVMSG %s :%s\r\n", dest, line); if (count >= LOGLINE_MAXLEN + 1) { mylog(LOG_DEBUG, "line too long"); buf[LOGLINE_MAXLEN - 2] = '\r'; buf[LOGLINE_MAXLEN - 1] = '\n'; buf[LOGLINE_MAXLEN] = 0; } return buf; } static int _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, 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), 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); if (!store) { mylog(LOG_ERROR, "Unable to find/create logfile for '%s'", destination); return; } _log_write(logdata, store, destination, str); } 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), 1); logdata->user = user; logdata->network = bip_strdup(network); hash_init(&logdata->logfgs, HASH_NOCASE); logdata->buffer = (char *)bip_malloc(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; int len; char *extracted; array_t *array = array_new();; do { if (!*p || strchr(splt, *p)) { len = 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; if (ischannel(*bl)) dest = bl; else dest = cli_nick; 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 = (char *)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.0-rc3/src/line.h0000644000175000017500000000546012442320231011565 00000000000000/* * $Id$ * * 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 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 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_free_args(char **elemv, int elemc); void irc_line_drop(struct line *line, int elem); #endif bip-0.9.0-rc3/src/line.c0000644000175000017500000001036212442320231011555 00000000000000/* * $Id$ * * 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. */ #include "config.h" #include "line.h" #include "util.h" 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, (char *)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; tmp = (char *)irc_line_elem(line, 1); array_set(&line->words, 1, nick); l = irc_line_to_string(line); array_set(&line->words, 1, tmp); 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) { free(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; } len = 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++; } len = 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++) free(array_get(&l->words, i)); array_deinit(&l->words); if (l->origin) free(l->origin); free(l); } void irc_line_free_args(char **elemv, int elemc) { int i; if (elemc == 0) return; for (i = 0; i < elemc; i++) free(elemv[i]); free(elemv); } bip-0.9.0-rc3/src/tuple.h0000644000175000017500000000120712442320231011762 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.0-rc3/src/util.h0000644000175000017500000001313012737401213011613 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 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 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; }; typedef struct list { struct list_item *first; struct list_item *last; int (*cmp)(); } list_t; 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; 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 interator 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); char *bip_strdup(const char *str); #define array_each(a, idx, ptr) for ((idx) = 0; \ (idx) < (a)->elemc && (((ptr) = 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); 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 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 = a->elemv[0]; free(a->elemv); a->elemv = NULL; a->elemc = 0; return ptr; } return a->elemv[--a->elemc]; } #endif bip-0.9.0-rc3/src/conf.c0000644000175000017500000022042413256270234011570 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Copy the first part of user declarations. */ #line 1 "src/conf.y" /* yacc.c:339 */ /* * $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 * * 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() { 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 136 "src/conf.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ #ifndef YY_YY_SRC_CONF_H_INCLUDED # define YY_YY_SRC_CONF_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { LEX_IP = 258, LEX_EQ = 259, LEX_PORT = 260, LEX_CSS = 261, LEX_SEMICOLON = 262, LEX_CONNECTION = 263, LEX_NETWORK = 264, LEX_LBRA = 265, LEX_RBRA = 266, LEX_USER = 267, LEX_NAME = 268, LEX_NICK = 269, LEX_SERVER = 270, LEX_PASSWORD = 271, LEX_SRCIP = 272, LEX_HOST = 273, LEX_VHOST = 274, LEX_SOURCE_PORT = 275, LEX_NONE = 276, LEX_COMMENT = 277, LEX_BUNCH = 278, LEX_REALNAME = 279, LEX_SSL = 280, LEX_SSL_CHECK_MODE = 281, LEX_SSL_CHECK_STORE = 282, LEX_SSL_CLIENT_CERTFILE = 283, LEX_CIPHERS = 284, LEX_CSS_CIPHERS = 285, LEX_DEFAULT_CIPHERS = 286, LEX_DH_PARAM = 287, LEX_CHANNEL = 288, LEX_KEY = 289, LEX_LOG_ROOT = 290, LEX_LOG_FORMAT = 291, LEX_LOG_LEVEL = 292, LEX_BACKLOG_LINES = 293, LEX_BACKLOG_NO_TIMESTAMP = 294, LEX_BACKLOG = 295, LEX_LOG = 296, LEX_LOG_SYSTEM = 297, LEX_LOG_SYNC_INTERVAL = 298, LEX_FOLLOW_NICK = 299, LEX_ON_CONNECT_SEND = 300, LEX_AWAY_NICK = 301, LEX_PID_FILE = 302, LEX_OIDENTD_FILE = 303, LEX_IGN_FIRST_NICK = 304, LEX_ALWAYS_BACKLOG = 305, LEX_BLRESET_ON_TALK = 306, LEX_BLRESET_CONNECTION = 307, LEX_DEFAULT_USER = 308, LEX_DEFAULT_NICK = 309, LEX_DEFAULT_REALNAME = 310, LEX_NO_CLIENT_AWAY_MSG = 311, LEX_BL_MSG_ONLY = 312, LEX_ADMIN = 313, LEX_BIP_USE_NOTICE = 314, LEX_CSS_PEM = 315, LEX_AUTOJOIN_ON_KICK = 316, LEX_IGNORE_CAPAB = 317, LEX_RECONN_TIMER = 318, LEX_BOOL = 319, LEX_INT = 320, LEX_STRING = 321 }; #endif /* Tokens. */ #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_NO_TIMESTAMP 294 #define LEX_BACKLOG 295 #define LEX_LOG 296 #define LEX_LOG_SYSTEM 297 #define LEX_LOG_SYNC_INTERVAL 298 #define LEX_FOLLOW_NICK 299 #define LEX_ON_CONNECT_SEND 300 #define LEX_AWAY_NICK 301 #define LEX_PID_FILE 302 #define LEX_OIDENTD_FILE 303 #define LEX_IGN_FIRST_NICK 304 #define LEX_ALWAYS_BACKLOG 305 #define LEX_BLRESET_ON_TALK 306 #define LEX_BLRESET_CONNECTION 307 #define LEX_DEFAULT_USER 308 #define LEX_DEFAULT_NICK 309 #define LEX_DEFAULT_REALNAME 310 #define LEX_NO_CLIENT_AWAY_MSG 311 #define LEX_BL_MSG_ONLY 312 #define LEX_ADMIN 313 #define LEX_BIP_USE_NOTICE 314 #define LEX_CSS_PEM 315 #define LEX_AUTOJOIN_ON_KICK 316 #define LEX_IGNORE_CAPAB 317 #define LEX_RECONN_TIMER 318 #define LEX_BOOL 319 #define LEX_INT 320 #define LEX_STRING 321 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 73 "src/conf.y" /* yacc.c:355 */ int number; char *string; void *list; struct tuple *tuple; #line 315 "src/conf.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_SRC_CONF_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 332 "src/conf.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 220 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 67 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 13 /* YYNRULES -- Number of rules. */ #define YYNRULES 82 /* YYNSTATES -- Number of states. */ #define YYNSTATES 227 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 321 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 88, 88, 89, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 109, 110, 112, 115, 118, 119, 122, 125, 128, 130, 133, 134, 137, 138, 139, 140, 144, 145, 148, 150, 152, 153, 155, 157, 159, 161, 163, 165, 167, 170, 173, 174, 177, 180, 183, 185, 189, 190, 194, 195, 197, 198, 199, 200, 202, 204, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 226, 227, 230, 231, 232, 235, 236, 239, 240 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "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_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_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_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 }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321 }; # endif #define YYPACT_NINF -51 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-51))) #define YYTABLE_NINF -1 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -51, 0, -51, -2, 6, 7, -6, 3, 14, 16, 17, 18, 20, 22, 23, 24, 30, 40, 41, 45, 49, 50, 51, 52, 54, 55, 57, 1, -50, 5, 10, -51, -51, 2, 9, 15, 19, 25, 11, 13, 29, 32, 36, 37, 38, 42, 44, 47, 48, 56, 58, 39, -51, -51, -51, -51, 4, 79, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 67, 70, 78, 80, 76, 103, -51, 84, 85, 112, 117, 118, 119, 121, 122, 123, 124, 131, 135, 136, 137, 138, 139, 140, 141, 81, -51, 82, 83, -51, -51, 86, 87, 88, 89, 90, 92, 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, 106, -51, -51, -4, -51, -51, 53, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 146, -51, 147, 156, 160, -51, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 185, 114, 125, -51, 127, 128, 129, 130, 132, 133, 142, 134, 143, -51, 126, 144, 145, 148, 149, 150, 151, 153, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 12, -51, -51, -51, -51, -51, -51, -51, -51, -51, 193, 197, 198, 196, 152, 154, 155, -51, -51, -51, -51 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 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, 28, 34, 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, 20, 21, 22, 15, 16, 17, 18, 19, 25, 23, 24, 11, 7, 26, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 29, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 30, 0, 31, 32, 0, 36, 37, 40, 41, 42, 46, 47, 48, 52, 49, 50, 43, 44, 45, 51, 38, 39, 0, 33, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 55, 82, 81, 57, 60, 56, 59, 62, 63, 64, 61, 73, 0, 58, 66, 71, 65, 67, 72, 68, 69, 70, 0, 0, 0, 0, 0, 0, 0, 75, 76, 77, 78 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 27, 56, 82, 57, 102, 131, 172, 206, 219, 128, 152 }; /* 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, 149, 28, 3, 31, 4, 5, 150, 52, 6, 29, 30, 7, 32, 151, 77, 53, 78, 33, 79, 34, 35, 36, 215, 37, 216, 38, 39, 40, 80, 8, 9, 10, 81, 41, 11, 12, 13, 14, 15, 16, 17, 18, 19, 42, 43, 217, 20, 21, 44, 22, 23, 218, 45, 46, 47, 48, 24, 49, 50, 25, 51, 153, 26, 154, 155, 156, 157, 58, 158, 54, 103, 159, 160, 55, 59, 63, 161, 64, 162, 104, 60, 105, 107, 106, 61, 163, 83, 109, 110, 84, 62, 85, 65, 164, 86, 66, 165, 166, 167, 67, 68, 168, 69, 76, 87, 88, 89, 70, 169, 71, 72, 73, 108, 170, 171, 111, 90, 91, 92, 74, 112, 113, 114, 75, 115, 116, 117, 118, 93, 94, 95, 96, 97, 98, 119, 99, 100, 101, 120, 121, 122, 123, 124, 125, 0, 129, 127, 126, 130, 173, 174, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 175, 176, 143, 144, 145, 146, 147, 148, 177, 178, 179, 180, 181, 182, 183, 184, 195, 186, 187, 188, 189, 190, 185, 191, 192, 193, 0, 207, 196, 194, 197, 198, 199, 200, 220, 201, 202, 204, 221, 222, 223, 0, 0, 0, 203, 208, 205, 0, 209, 0, 211, 210, 213, 212, 214, 224, 226, 225 }; static const yytype_int8 yycheck[] = { 0, 5, 4, 3, 10, 5, 6, 11, 7, 9, 4, 4, 12, 10, 18, 11, 66, 13, 4, 15, 4, 4, 4, 11, 4, 13, 4, 4, 4, 25, 30, 31, 32, 29, 4, 35, 36, 37, 38, 39, 40, 41, 42, 43, 4, 4, 34, 47, 48, 4, 50, 51, 40, 4, 4, 4, 4, 57, 4, 4, 60, 4, 9, 63, 11, 12, 13, 14, 66, 16, 65, 4, 19, 20, 64, 66, 65, 24, 65, 26, 10, 66, 4, 7, 4, 66, 33, 8, 4, 4, 11, 66, 13, 64, 41, 16, 64, 44, 45, 46, 64, 64, 49, 65, 65, 26, 27, 28, 66, 56, 66, 64, 64, 10, 61, 62, 4, 38, 39, 40, 64, 4, 4, 4, 66, 4, 4, 4, 4, 50, 51, 52, 53, 54, 55, 4, 57, 58, 59, 4, 4, 4, 4, 4, 4, -1, 64, 66, 7, 66, 4, 4, 66, 66, 66, 66, 66, 65, 64, 64, 64, 64, 64, 7, 4, 66, 66, 66, 64, 64, 64, 4, 4, 4, 4, 4, 4, 4, 4, 65, 4, 4, 4, 4, 4, 10, 4, 4, 4, -1, 64, 66, 7, 66, 66, 66, 66, 4, 66, 66, 66, 4, 4, 7, -1, -1, -1, 65, 64, 66, -1, 66, -1, 64, 66, 64, 66, 64, 66, 64, 66 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 68, 0, 3, 5, 6, 9, 12, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 47, 48, 50, 51, 57, 60, 63, 69, 4, 4, 4, 10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 66, 65, 64, 70, 72, 66, 66, 66, 66, 66, 65, 65, 64, 64, 64, 64, 65, 66, 66, 64, 64, 64, 66, 65, 11, 13, 15, 25, 29, 71, 8, 11, 13, 16, 26, 27, 28, 38, 39, 40, 50, 51, 52, 53, 54, 55, 57, 58, 59, 73, 4, 10, 4, 4, 7, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 66, 78, 64, 66, 74, 66, 66, 66, 66, 66, 65, 64, 64, 64, 64, 64, 66, 66, 66, 64, 64, 64, 5, 11, 18, 79, 9, 11, 12, 13, 14, 16, 19, 20, 24, 26, 33, 41, 44, 45, 46, 49, 56, 61, 62, 75, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 10, 4, 4, 4, 4, 4, 4, 4, 4, 7, 65, 66, 66, 66, 66, 66, 66, 66, 65, 66, 66, 76, 64, 64, 66, 66, 64, 66, 64, 64, 11, 13, 34, 40, 77, 4, 4, 4, 7, 66, 66, 64 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 67, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 71, 71, 71, 71, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 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, 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, 4, 0, 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 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 88 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = root_list = list_new(NULL); } #line 1564 "src/conf.c" /* yacc.c:1646 */ break; case 3: #line 89 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1570 "src/conf.c" /* yacc.c:1646 */ break; case 4: #line 93 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_LOG_ROOT, (yyvsp[0].string)); } #line 1576 "src/conf.c" /* yacc.c:1646 */ break; case 5: #line 94 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_LOG_FORMAT, (yyvsp[0].string)); } #line 1583 "src/conf.c" /* yacc.c:1646 */ break; case 6: #line 96 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_LOG_LEVEL, (yyvsp[0].number)); } #line 1589 "src/conf.c" /* yacc.c:1646 */ break; case 7: #line 97 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_RECONN_TIMER, (yyvsp[0].number)); } #line 1595 "src/conf.c" /* yacc.c:1646 */ break; case 8: #line 98 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_IP, (yyvsp[0].string)); } #line 1601 "src/conf.c" /* yacc.c:1646 */ break; case 9: #line 99 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_PORT, (yyvsp[0].number)); } #line 1607 "src/conf.c" /* yacc.c:1646 */ break; case 10: #line 100 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_CSS, (yyvsp[0].number)); } #line 1613 "src/conf.c" /* yacc.c:1646 */ break; case 11: #line 101 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_CSS_PEM, (yyvsp[0].string)); } #line 1619 "src/conf.c" /* yacc.c:1646 */ break; case 12: #line 102 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_CSS_CIPHERS, (yyvsp[0].string)); } #line 1625 "src/conf.c" /* yacc.c:1646 */ break; case 13: #line 103 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_CIPHERS, (yyvsp[0].string)); } #line 1631 "src/conf.c" /* yacc.c:1646 */ break; case 14: #line 104 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_DH_PARAM, (yyvsp[0].string)); } #line 1637 "src/conf.c" /* yacc.c:1646 */ break; case 15: #line 105 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_LOG, (yyvsp[0].number)); } #line 1643 "src/conf.c" /* yacc.c:1646 */ break; case 16: #line 106 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_LOG_SYSTEM, (yyvsp[0].number)); } #line 1649 "src/conf.c" /* yacc.c:1646 */ break; case 17: #line 107 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new( LEX_LOG_SYNC_INTERVAL, (yyvsp[0].number)); } #line 1656 "src/conf.c" /* yacc.c:1646 */ break; case 18: #line 109 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_PID_FILE, (yyvsp[0].string)); } #line 1662 "src/conf.c" /* yacc.c:1646 */ break; case 19: #line 110 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_OIDENTD_FILE, (yyvsp[0].string)); } #line 1668 "src/conf.c" /* yacc.c:1646 */ break; case 20: #line 112 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_LINES, (yyvsp[0].number)); } #line 1676 "src/conf.c" /* yacc.c:1646 */ break; case 21: #line 115 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, (yyvsp[0].number)); } #line 1684 "src/conf.c" /* yacc.c:1646 */ break; case 22: #line 118 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 1690 "src/conf.c" /* yacc.c:1646 */ break; case 23: #line 119 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BLRESET_ON_TALK, (yyvsp[0].number)); } #line 1698 "src/conf.c" /* yacc.c:1646 */ break; case 24: #line 122 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BL_MSG_ONLY, (yyvsp[0].number)); } #line 1706 "src/conf.c" /* yacc.c:1646 */ break; case 25: #line 125 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new( LEX_ALWAYS_BACKLOG, (yyvsp[0].number)); } #line 1713 "src/conf.c" /* yacc.c:1646 */ break; case 26: #line 128 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_l_new(LEX_NETWORK, (yyvsp[-1].list)); } #line 1720 "src/conf.c" /* yacc.c:1646 */ break; case 27: #line 130 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_l_new(LEX_USER, (yyvsp[-1].list)); } #line 1726 "src/conf.c" /* yacc.c:1646 */ break; case 28: #line 133 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = list_new(NULL); } #line 1732 "src/conf.c" /* yacc.c:1646 */ break; case 29: #line 134 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1738 "src/conf.c" /* yacc.c:1646 */ break; case 30: #line 137 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1744 "src/conf.c" /* yacc.c:1646 */ break; case 31: #line 138 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_SSL, (yyvsp[0].number)); } #line 1750 "src/conf.c" /* yacc.c:1646 */ break; case 32: #line 139 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_CIPHERS, (yyvsp[0].string)); } #line 1756 "src/conf.c" /* yacc.c:1646 */ break; case 33: #line 140 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_l_new(LEX_SERVER, (yyvsp[-1].list)); } #line 1763 "src/conf.c" /* yacc.c:1646 */ break; case 34: #line 144 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = list_new(NULL); } #line 1769 "src/conf.c" /* yacc.c:1646 */ break; case 35: #line 145 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1775 "src/conf.c" /* yacc.c:1646 */ break; case 36: #line 148 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1782 "src/conf.c" /* yacc.c:1646 */ break; case 37: #line 150 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_PASSWORD, (yyvsp[0].string)); } #line 1789 "src/conf.c" /* yacc.c:1646 */ break; case 38: #line 152 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_ADMIN, (yyvsp[0].number)); } #line 1795 "src/conf.c" /* yacc.c:1646 */ break; case 39: #line 153 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BIP_USE_NOTICE, (yyvsp[0].number)); } #line 1802 "src/conf.c" /* yacc.c:1646 */ break; case 40: #line 155 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_MODE, (yyvsp[0].string)); } #line 1809 "src/conf.c" /* yacc.c:1646 */ break; case 41: #line 157 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_STORE, (yyvsp[0].string)); } #line 1816 "src/conf.c" /* yacc.c:1646 */ break; case 42: #line 159 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_SSL_CLIENT_CERTFILE, (yyvsp[0].string)); } #line 1823 "src/conf.c" /* yacc.c:1646 */ break; case 43: #line 161 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_USER, (yyvsp[0].string)); } #line 1830 "src/conf.c" /* yacc.c:1646 */ break; case 44: #line 163 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_NICK, (yyvsp[0].string)); } #line 1837 "src/conf.c" /* yacc.c:1646 */ break; case 45: #line 165 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_DEFAULT_REALNAME, (yyvsp[0].string)); } #line 1844 "src/conf.c" /* yacc.c:1646 */ break; case 46: #line 167 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_LINES, (yyvsp[0].number)); } #line 1852 "src/conf.c" /* yacc.c:1646 */ break; case 47: #line 170 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG_NO_TIMESTAMP, (yyvsp[0].number)); } #line 1860 "src/conf.c" /* yacc.c:1646 */ break; case 48: #line 173 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 1866 "src/conf.c" /* yacc.c:1646 */ break; case 49: #line 174 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BLRESET_ON_TALK, (yyvsp[0].number)); } #line 1874 "src/conf.c" /* yacc.c:1646 */ break; case 50: #line 177 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BLRESET_CONNECTION, (yyvsp[0].number)); } #line 1882 "src/conf.c" /* yacc.c:1646 */ break; case 51: #line 180 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BL_MSG_ONLY, (yyvsp[0].number)); } #line 1890 "src/conf.c" /* yacc.c:1646 */ break; case 52: #line 183 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new( LEX_ALWAYS_BACKLOG, (yyvsp[0].number)); } #line 1897 "src/conf.c" /* yacc.c:1646 */ break; case 53: #line 185 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_l_new(LEX_CONNECTION, (yyvsp[-1].list)); } #line 1904 "src/conf.c" /* yacc.c:1646 */ break; case 54: #line 189 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = list_new(NULL); } #line 1910 "src/conf.c" /* yacc.c:1646 */ break; case 55: #line 190 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 1917 "src/conf.c" /* yacc.c:1646 */ break; case 56: #line 194 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 1923 "src/conf.c" /* yacc.c:1646 */ break; case 57: #line 195 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NETWORK, (yyvsp[0].string)); } #line 1930 "src/conf.c" /* yacc.c:1646 */ break; case 58: #line 197 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_LOG, (yyvsp[0].number)); } #line 1936 "src/conf.c" /* yacc.c:1646 */ break; case 59: #line 198 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NICK, (yyvsp[0].string)); } #line 1942 "src/conf.c" /* yacc.c:1646 */ break; case 60: #line 199 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_USER, (yyvsp[0].string)); } #line 1948 "src/conf.c" /* yacc.c:1646 */ break; case 61: #line 200 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_REALNAME, (yyvsp[0].string)); } #line 1955 "src/conf.c" /* yacc.c:1646 */ break; case 62: #line 202 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_PASSWORD, (yyvsp[0].string)); } #line 1962 "src/conf.c" /* yacc.c:1646 */ break; case 63: #line 204 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_VHOST, (yyvsp[0].string)); } #line 1968 "src/conf.c" /* yacc.c:1646 */ break; case 64: #line 205 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_SOURCE_PORT, (yyvsp[0].number)); } #line 1975 "src/conf.c" /* yacc.c:1646 */ break; case 65: #line 207 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_AWAY_NICK, (yyvsp[0].string)); } #line 1982 "src/conf.c" /* yacc.c:1646 */ break; case 66: #line 209 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_FOLLOW_NICK, (yyvsp[0].number)); } #line 1989 "src/conf.c" /* yacc.c:1646 */ break; case 67: #line 211 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new( LEX_IGN_FIRST_NICK, (yyvsp[0].number)); } #line 1996 "src/conf.c" /* yacc.c:1646 */ break; case 68: #line 213 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_AUTOJOIN_ON_KICK, (yyvsp[0].number)); } #line 2003 "src/conf.c" /* yacc.c:1646 */ break; case 69: #line 215 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_IGNORE_CAPAB, (yyvsp[0].number)); } #line 2010 "src/conf.c" /* yacc.c:1646 */ break; case 70: #line 217 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_l_new( LEX_CHANNEL, (yyvsp[-1].list)); } #line 2017 "src/conf.c" /* yacc.c:1646 */ break; case 71: #line 219 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_ON_CONNECT_SEND, (yyvsp[0].string)); } #line 2024 "src/conf.c" /* yacc.c:1646 */ break; case 72: #line 221 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_NO_CLIENT_AWAY_MSG, (yyvsp[0].string)); } #line 2031 "src/conf.c" /* yacc.c:1646 */ break; case 73: #line 223 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new( LEX_SSL_CHECK_MODE, (yyvsp[0].string)); } #line 2038 "src/conf.c" /* yacc.c:1646 */ break; case 74: #line 226 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = list_new(NULL); } #line 2044 "src/conf.c" /* yacc.c:1646 */ break; case 75: #line 227 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 2050 "src/conf.c" /* yacc.c:1646 */ break; case 76: #line 230 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_NAME, (yyvsp[0].string)); } #line 2056 "src/conf.c" /* yacc.c:1646 */ break; case 77: #line 231 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_KEY, (yyvsp[0].string)); } #line 2062 "src/conf.c" /* yacc.c:1646 */ break; case 78: #line 232 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_BACKLOG, (yyvsp[0].number)); } #line 2068 "src/conf.c" /* yacc.c:1646 */ break; case 79: #line 235 "src/conf.y" /* yacc.c:1646 */ { (yyval.list) = list_new(NULL); } #line 2074 "src/conf.c" /* yacc.c:1646 */ break; case 80: #line 236 "src/conf.y" /* yacc.c:1646 */ { list_add_last((yyvsp[-2].list), (yyvsp[-1].tuple)); (yyval.list) = (yyvsp[-2].list); } #line 2080 "src/conf.c" /* yacc.c:1646 */ break; case 81: #line 239 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_s_new(LEX_HOST, (yyvsp[0].string)); } #line 2086 "src/conf.c" /* yacc.c:1646 */ break; case 82: #line 240 "src/conf.y" /* yacc.c:1646 */ { (yyval.tuple) = tuple_i_new(LEX_PORT, (yyvsp[0].number)); } #line 2092 "src/conf.c" /* yacc.c:1646 */ break; #line 2096 "src/conf.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } bip-0.9.0-rc3/src/log.h0000644000175000017500000000644512442320231011423 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 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 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; size_t 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.0-rc3/src/bip.c0000644000175000017500000016367513254604323011431 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 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. */ #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" 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; 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); #ifdef HAVE_OIDENTD #define OIDENTD_FILENAME ".oidentd.conf" #endif 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(20); for (i = 0; i < 20; i++) { sscanf(hex + 2 * i, "%02x", &buf); md5[i] = buf; } *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 = 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 conf_die(bip_t *bip, char *fmt, ...) { va_list ap; int 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 && n < size) { list_add_last(&bip->errors, error); break; } if (n > -1) size = n + 1; else size *= 2; error = bip_realloc(error, size); } va_start(ap, fmt); _mylog(LOG_ERROR, fmt, ap); va_end(ap); } FILE *conf_global_log_file; 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(); } /* RACE CONDITION! */ int do_pid_stuff(void) { char hname[1024]; char longpath[1024]; FILE *f; int fd; try_again: fd = -1; f = fopen(conf_pid_file, "r"); if (f) goto pid_is_there; if (gethostname(hname, 1023) == -1) fatal("%s %s", "gethostname", strerror(errno)); snprintf(longpath, 1023, "%s.%s.%ld", conf_pid_file, hname, (long unsigned int)getpid()); 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); return fd; pid_is_there: { pid_t pid; long unsigned int p; if (fd != -1) close(fd); if (f) { int c = fscanf(f, "%ld", &p); fclose(f); pid = 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 runing."); mylog(LOG_FATAL, "If you are sure this is not the case remove" " %s.", conf_pid_file); exit(2); } return 0; } #define S_CONF "bip.conf" 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() { printf( "Bip IRC Proxy - " PACKAGE_VERSION "\n" "Copyright © Arnaud Cornet and Loïc Gomez (2004 - 2008)\n" "Distributed under the GNU Public License Version 2\n"); } bip_t *_bip; 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), 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: n->serverv = bip_realloc(n->serverv, (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 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_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; } 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; break; case LEX_FOLLOW_NICK: l->follow_nick = t->ndata; break; case LEX_IGN_FIRST_NICK: l->ignore_first_nick = t->ndata; break; case LEX_IGNORE_CAPAB: l->ignore_server_capab = t->ndata; 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; 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); } 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; } struct historical_directives { int always_backlog; int backlog; int bl_msg_only; int backlog_lines; int backlog_no_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), 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_no_timestamp = DEFAULT_BACKLOG_NO_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; u->always_backlog = hds->always_backlog; u->bl_msg_only = hds->bl_msg_only; u->backlog_lines = hds->backlog_lines; u->backlog_no_timestamp = hds->backlog_no_timestamp; u->blreset_on_talk = hds->blreset_on_talk; 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; 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; break; case LEX_BACKLOG: u->backlog = t->ndata; break; case LEX_BL_MSG_ONLY: u->bl_msg_only = t->ndata; break; case LEX_BACKLOG_LINES: u->backlog_lines = t->ndata; break; case LEX_BACKLOG_NO_TIMESTAMP: u->backlog_no_timestamp = t->ndata; break; case LEX_BLRESET_ON_TALK: u->blreset_on_talk = t->ndata; break; case LEX_BLRESET_CONNECTION: u->blreset_connection = t->ndata; break; case LEX_BIP_USE_NOTICE: u->bip_use_notice = t->ndata; 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, "Uknown 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_no_timestamp, BACKLOG_NO_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 = 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; #ifdef HAVE_OIDENTD case LEX_OIDENTD_FILE: MOVE_STRING(bip->oidentdpath, t->pdata); break; #else case LEX_OIDENTD_FILE: mylog(LOG_WARN, "Found oidentd option whereas bip is " "not built with oidentd support."); break; #endif 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_no_timestamp = t->ndata; 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; } 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, 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; } } void check_rlimits() { 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'"); } 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"); } #ifdef HAVE_OIDENTD 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); } #endif 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"); 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, 29, "%ld\n", (long unsigned int)pid); write(fd, buf, strlen(buf)); 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; } #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[RET_STR_LEN + 1]; int t_written = 0; 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)); t_written = snprintf(buf, RET_STR_LEN, " Options:"); if (t_written >= RET_STR_LEN) goto noroom; if (lnk->follow_nick) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " follow_nick"); if (t_written >= RET_STR_LEN) goto noroom; } if (lnk->ignore_first_nick) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " ignore_first_nick"); if (t_written >= RET_STR_LEN) goto noroom; } if (lnk->away_nick) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " away_nick=%s", lnk->away_nick); if (t_written >= RET_STR_LEN) goto noroom; } if (lnk->no_client_away_msg) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " no_client_away_msg=%s", lnk->no_client_away_msg); if (t_written >= RET_STR_LEN) goto noroom; } if (lnk->vhost) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " vhost=%s", lnk->vhost); if (t_written >= RET_STR_LEN) goto noroom; } if (lnk->bind_port) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " bind_port=%u", lnk->bind_port); if (t_written >= RET_STR_LEN) goto noroom; } noroom: /* that means the line is larger that RET_STR_LEN. We're not likely to even read such a long line */ buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); // TODO: on_connect_send // TODO : check channels struct t_written = snprintf(buf, RET_STR_LEN, " Channels (* with key, ` no backlog)"); if (t_written >= RET_STR_LEN) goto noroomchan; for (hash_it_init(&lnk->chan_infos, &lit); hash_it_item(&lit); hash_it_next(&lit)) { struct chan_info *ch = hash_it_item(&lit); t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " %s%s%s", ch->name, (ch->key ? "*" : ""), (ch->backlog ? "" : "`")); if (t_written > LINE_SIZE_LIM) { buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); t_written = 0; } } noroomchan: buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); t_written = snprintf(buf, RET_STR_LEN, " Status: "); if (t_written >= RET_STR_LEN) goto noroomstatus; switch (lnk->s_state) { case IRCS_NONE: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "not started"); if (t_written >= RET_STR_LEN) goto noroomstatus; break; case IRCS_CONNECTING: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "connecting... attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (t_written >= RET_STR_LEN) goto noroomstatus; break; case IRCS_CONNECTED: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "connected !"); if (t_written >= RET_STR_LEN) goto noroomstatus; break; case IRCS_WAS_CONNECTED: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "disconnected, attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (t_written >= RET_STR_LEN) goto noroomstatus; break; case IRCS_RECONNECTING: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "reconnecting... attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (t_written >= RET_STR_LEN) goto noroomstatus; break; case IRCS_TIMER_WAIT: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "waiting to reconnect, attempts: %d, last: %s", lnk->s_conn_attempt, hrtime(lnk->last_connection_attempt)); if (t_written >= RET_STR_LEN) goto noroomstatus; break; default: t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "unknown"); if (t_written >= RET_STR_LEN) goto noroomstatus; break; // s_conn_attempt recon_timer last_connection_attempt } noroomstatus: buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); } 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; char buf[RET_STR_LEN + 1]; int t_written = 0; bip_notify(ic, "-- User '%s' info", name); u = hash_get(&_bip->users, name); if (!u) { bip_notify(ic, "Unknown user"); return; } t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, "user: %s", u->name); if (t_written >= RET_STR_LEN) goto noroom; if (u->admin) { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, ", is bip admin"); if (t_written >= RET_STR_LEN) goto noroom; } noroom: buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); #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, no timestamp: %s," " messages only: %s", u->backlog_lines, bool2text(u->backlog_no_timestamp), 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[RET_STR_LEN + 1]; 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; int t_written = 0; buf[RET_STR_LEN] = 0; t_written += snprintf(buf, RET_STR_LEN, "* %s%s:", u->name, (u->admin ? "(admin)": "")); if (t_written >= RET_STR_LEN) goto noroom; for (hash_it_init(&u->connections, &lit); hash_it_item(&lit); hash_it_next(&lit)) { struct link *lnk = hash_it_item(&lit); if (first) { first = 0; } else { t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, ","); if (t_written >= RET_STR_LEN) goto noroom; } t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " %s", lnk->name); if (t_written >= RET_STR_LEN) goto noroom; if (t_written > LINE_SIZE_LIM) { buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); t_written = 0; } } noroom: buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); } bip_notify(ic, "-- End of User list"); } 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 t_written = 0; int i; buf[RET_STR_LEN] = 0; #ifdef HAVE_LIBSSL if (n->ssl) { t_written += snprintf(buf, RET_STR_LEN, "- %s*:", n->name); if (t_written >= RET_STR_LEN) goto noroom; } else { #endif t_written += snprintf(buf, RET_STR_LEN, "- %s:", n->name); if (t_written >= RET_STR_LEN) goto noroom; #ifdef HAVE_LIBSSL } #endif for (i = 0; i < n->serverc; i++) { struct server *serv = i+n->serverv; t_written += snprintf(buf + t_written, RET_STR_LEN - t_written, " %s:%d", serv->host, serv->port); if (t_written >= RET_STR_LEN) goto noroom; if (t_written > LINE_SIZE_LIM) { buf[RET_STR_LEN] = 0; bip_notify(ic, "%s", buf); t_written = 0; } } noroom: 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... */ unbind_from_link(ic); 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, 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 resetted 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 resetted 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, unsigned int privmsg) { char buf[ON_CONNECT_MAX_STRSIZE]; int t_written = 0; int i; if (!line) { set_on_connect_send(ic, NULL); return; } if (irc_line_includes(line, 2)) return; for (i = privmsg + 2; i < irc_line_count(line); i++) { if (t_written) { t_written += snprintf(buf, ON_CONNECT_MAX_STRSIZE - 1 - t_written, " %s", irc_line_elem(line, i)); if (t_written >= ON_CONNECT_MAX_STRSIZE) goto noroom; } else { t_written = snprintf(buf, ON_CONNECT_MAX_STRSIZE - 1, "%s", irc_line_elem(line, i)); if (t_written >= ON_CONNECT_MAX_STRSIZE) goto noroom; } } ok: buf[ON_CONNECT_MAX_STRSIZE - 1] = 0; set_on_connect_send(ic, buf); return; noroom: bip_notify(ic, "on connect send string too big, truncated"); goto ok; } 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; int 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, " "))) { slen = eptr - ptr; if (slen == 0) { ptr++; continue; } memcpy(elemstr, ptr, slen); elemstr[slen] = 0; irc_line_append(line, elemstr); ptr = eptr + 1; } eptr = ptr + strlen(ptr); slen = eptr - ptr; 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 (strcasecmp(irc_line_elem(line, privmsg + 1), "RELOAD") == 0) { 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 (strcasecmp(irc_line_elem(line, privmsg + 1), "LIST") == 0) { 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 (strcasecmp(irc_line_elem(line, privmsg + 1), "INFO") == 0) { if (!irc_line_includes(line, privmsg + 2)) { bip_notify(ic, "-- INFO command needs at least one " "argument"); return OK_FORGET; } if (admin && irc_line_elem_case_equals(line, privmsg + 2, "user") == 0) { 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.0-rc3/src/lex.l0000644000175000017500000001011013051303063011417 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 * * 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_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; } "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; } "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.0-rc3/src/conf.h0000644000175000017500000001260013256270234011570 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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. */ #ifndef YY_YY_SRC_CONF_H_INCLUDED # define YY_YY_SRC_CONF_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { LEX_IP = 258, LEX_EQ = 259, LEX_PORT = 260, LEX_CSS = 261, LEX_SEMICOLON = 262, LEX_CONNECTION = 263, LEX_NETWORK = 264, LEX_LBRA = 265, LEX_RBRA = 266, LEX_USER = 267, LEX_NAME = 268, LEX_NICK = 269, LEX_SERVER = 270, LEX_PASSWORD = 271, LEX_SRCIP = 272, LEX_HOST = 273, LEX_VHOST = 274, LEX_SOURCE_PORT = 275, LEX_NONE = 276, LEX_COMMENT = 277, LEX_BUNCH = 278, LEX_REALNAME = 279, LEX_SSL = 280, LEX_SSL_CHECK_MODE = 281, LEX_SSL_CHECK_STORE = 282, LEX_SSL_CLIENT_CERTFILE = 283, LEX_CIPHERS = 284, LEX_CSS_CIPHERS = 285, LEX_DEFAULT_CIPHERS = 286, LEX_DH_PARAM = 287, LEX_CHANNEL = 288, LEX_KEY = 289, LEX_LOG_ROOT = 290, LEX_LOG_FORMAT = 291, LEX_LOG_LEVEL = 292, LEX_BACKLOG_LINES = 293, LEX_BACKLOG_NO_TIMESTAMP = 294, LEX_BACKLOG = 295, LEX_LOG = 296, LEX_LOG_SYSTEM = 297, LEX_LOG_SYNC_INTERVAL = 298, LEX_FOLLOW_NICK = 299, LEX_ON_CONNECT_SEND = 300, LEX_AWAY_NICK = 301, LEX_PID_FILE = 302, LEX_OIDENTD_FILE = 303, LEX_IGN_FIRST_NICK = 304, LEX_ALWAYS_BACKLOG = 305, LEX_BLRESET_ON_TALK = 306, LEX_BLRESET_CONNECTION = 307, LEX_DEFAULT_USER = 308, LEX_DEFAULT_NICK = 309, LEX_DEFAULT_REALNAME = 310, LEX_NO_CLIENT_AWAY_MSG = 311, LEX_BL_MSG_ONLY = 312, LEX_ADMIN = 313, LEX_BIP_USE_NOTICE = 314, LEX_CSS_PEM = 315, LEX_AUTOJOIN_ON_KICK = 316, LEX_IGNORE_CAPAB = 317, LEX_RECONN_TIMER = 318, LEX_BOOL = 319, LEX_INT = 320, LEX_STRING = 321 }; #endif /* Tokens. */ #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_NO_TIMESTAMP 294 #define LEX_BACKLOG 295 #define LEX_LOG 296 #define LEX_LOG_SYSTEM 297 #define LEX_LOG_SYNC_INTERVAL 298 #define LEX_FOLLOW_NICK 299 #define LEX_ON_CONNECT_SEND 300 #define LEX_AWAY_NICK 301 #define LEX_PID_FILE 302 #define LEX_OIDENTD_FILE 303 #define LEX_IGN_FIRST_NICK 304 #define LEX_ALWAYS_BACKLOG 305 #define LEX_BLRESET_ON_TALK 306 #define LEX_BLRESET_CONNECTION 307 #define LEX_DEFAULT_USER 308 #define LEX_DEFAULT_NICK 309 #define LEX_DEFAULT_REALNAME 310 #define LEX_NO_CLIENT_AWAY_MSG 311 #define LEX_BL_MSG_ONLY 312 #define LEX_ADMIN 313 #define LEX_BIP_USE_NOTICE 314 #define LEX_CSS_PEM 315 #define LEX_AUTOJOIN_ON_KICK 316 #define LEX_IGNORE_CAPAB 317 #define LEX_RECONN_TIMER 318 #define LEX_BOOL 319 #define LEX_INT 320 #define LEX_STRING 321 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 73 "src/conf.y" /* yacc.c:1909 */ int number; char *string; void *list; struct tuple *tuple; #line 193 "src/conf.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_SRC_CONF_H_INCLUDED */ bip-0.9.0-rc3/src/irc.c0000644000175000017500000020330613051303063011406 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 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. */ #include "config.h" #include #include #include #include "util.h" #include "irc.h" #include "bip.h" #include "log.h" #include "connection.h" #include "md5.h" #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 get_index(const char* str, char car); static int fls(int v); #ifdef HAVE_OIDENTD #define OIDENTD_FILENAME ".oidentd.conf" void oidentd_dump(bip_t *bip); #endif 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); #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), 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; assert(mask); while (*nick && *nick != '!') nick++; if (!*nick) return bip_strdup(mask); len = nick - mask; 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(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(NAMESIZE + 1); *str = 0; len = 0; } if (len != 0) { strcat(str, " "); len++; } // prepend symbol corresponding to the usermode int msb; if ((msb = 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 */ 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) { assert(is->laginit_ts != -1); is->lag = time(NULL) - is->laginit_ts; } 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) { 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)) { ssize_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, UNUSED(struct line *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) { 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, "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] = rand() * ('z' - 'a') / RAND_MAX + 'a'; } 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=", 10)) server_set_chanmodes(server, irc_line_elem(line, i) + 10); else if (!strncmp(irc_line_elem(line, i), "PREFIX=(", 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) { 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) { 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); 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]; 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))) { if (index < num) { index++; cur = c + 1; continue; } if (c - cur < 1) return NULL; ret = bip_malloc(c - cur + 1); strncpy(ret, cur, c - cur); ret[c - cur] = 0; return ret; } if (index == num) { c = str + strlen(str); if (c - cur < 1) return NULL; ret = bip_malloc(c - cur + 1); strncpy(ret, cur, c - cur); ret[c - cur] = 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) { 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; if (!ischannel(*chan)) return; ci = hash_get(&LINK(ircs)->chan_infos, chan); if (!ci) { struct chan_info *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 = e - s; 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 = 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; char *cname; if (irc_line_count(line) != 2 && irc_line_count(line) != 3) return ERR_PROTOCOL; cname = (char *)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) { 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; } 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; } /* LINK(src) == LINK(dest) */ size_t len = strlen(irc_line_elem(line, 2)) + 5; 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_loging_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_LOGING_CLIENT: return irc_dispatch_loging_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("gnéééééé"); } 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 (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); 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 */ while ((index = get_index(server->prefixes, *names))) { ovmask |= 1 << index; names++; } eon = names; while (*eon && *eon != ' ') eon++; len = eon - names; 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, UNUSED(struct line *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); 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) { int 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) { int 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 { if (add) { mode_add_letter_uniq(server, *mode); } else { mode_remove_letter(server, *mode); } } } } static int irc_mode(struct link_server *server, struct line *line) { struct channel *channel; const char *mode; int add = 1; unsigned 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; } if (!ischannel(irc_line_elem(line, 1)[0])) return ERR_PROTOCOL; /* 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; 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 = 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); } return OK_COPY; } static char *irc_timestamp(void) { char *ts = bip_malloc(21); snprintf(ts, 20, "%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); 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); 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); 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 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), 1); CONN(ircc) = newconn; TYPE(ircc) = IRC_TYPE_LOGING_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_LOGING_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), 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), 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 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); #ifdef HAVE_OIDENTD oidentd_dump(_bip); #endif 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); } #ifdef HAVE_OIDENTD #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) { 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; } content = (char *)bip_malloc(stats.st_size + 1); if (fread(content, 1, 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, SEEK_SET, 0); if (ftruncate(fileno(f), 0) == -1) { mylog(LOG_DEBUG, "Can't reset %s size", bip->oidentdpath); free(content); goto clean_oidentd; } bipend = strstr(bipstart, BIP_OIDENTD_END); /* data preceeding the tag */ fwrite(content, 1, bipstart - content, f); /* data following the tag, if any */ if (bipend != NULL) fwrite(bipend + BIP_OIDENTD_END_LENGTH, 1, stats.st_size - (bipend - content) - BIP_OIDENTD_END_LENGTH, f); else mylog(LOG_WARN, "No %s mark found in %s", BIP_OIDENTD_END, bip->oidentdpath); } 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); } #endif 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] Error in protocol, closing...", link_name(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, closing...", link_name(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_LOGING_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) { int 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); #ifdef HAVE_OIDENTD if (nc) oidentd_dump(bip); #endif 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() { struct link *link; link = bip_calloc(sizeof(struct link), 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->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) len = 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(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; unsigned int 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; } len = 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 get_index(const char* str, char car) { char *cur; if ((cur = strchr(str, car))) return cur - str + 1; else return 0; } static int fls(int v) { unsigned int r = 0; while (v >>= 1) r++; return r; } bip-0.9.0-rc3/src/irc.h0000644000175000017500000001243013051303063011407 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 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_LOGING_CLIENT (2) #define IRC_TYPE_TRUST_CLIENT (3) 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 */ int backlog:1; int backlog_lines; int always_backlog:1; int bl_msg_only:1; int backlog_no_timestamp:1; int blreset_on_talk:1; int blreset_connection:1; #ifdef HAVE_LIBSSL int ssl_check_mode; char *ssl_check_store; char *ssl_client_certfile; #endif hash_t connections; int in_use:1; /* for mark and sweep on reload */ }; struct network { char *name; #ifdef HAVE_LIBSSL int ssl; char *ciphers; #endif int serverc; struct server *serverv; }; struct link { char *name; /* id */ /** link live data **/ struct link_server *l_server; 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 */ int follow_nick:1; int ignore_first_nick:1; int autojoin_on_kick:1; int ignore_server_capab:1; 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 *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), 1) struct link_server { struct link_connection _link_c; char *nick; /* channels we are in */ hash_t channels; char *user_mode; int user_mode_len; /* init stuff */ int lag; int 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; #ifdef HAVE_OIDENTD char *oidentdpath; #endif } 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 irc_main(bip_t *); int ischannel(char p); void irc_client_close(struct link_client *); void irc_client_free(struct link_client *); struct link *irc_link_new(); 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.0-rc3/src/defaults.h0000644000175000017500000000176013051303063012445 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 #define DEFAULT_BACKLOG 1 #define DEFAULT_ALWAYS_BACKLOG 0 #define DEFAULT_BL_MSG_ONLY 0 #define DEFAULT_BACKLOG_LINES 10 #define DEFAULT_BACKLOG_NO_TIMESTAMP 0 #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.0-rc3/src/path_util.h0000644000175000017500000000131113254604342012630 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.0-rc3/src/path_util.c0000644000175000017500000000200613254604342012625 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.0-rc3/src/conf.y0000644000175000017500000002214513051303063011604 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 * * 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() { 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_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_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 %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_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_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_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_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.0-rc3/INSTALL0000644000175000017500000001722712442320231010733 00000000000000Basic Installation ================== These are generic installation instructions. 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, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). 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 at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 4. Type `make install' to install the programs and any data files and documentation. 5. 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. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 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 must use a version of `make' that supports the `VPATH' variable, such as 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 `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have 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. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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. 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'. Optional Features ================= 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. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM 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 host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. 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. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--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. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. bip-0.9.0-rc3/compile0000744000175000017500000001624513256270226011271 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: bip-0.9.0-rc3/README0000644000175000017500000002102012442320231010544 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 --enable-oidentd && make From repository: # autoreconf -i -Wall # ./configure --enable-maintainer-mode --enable-oidentd && 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 --enable-oidentd && 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 requiring, you can set up an oidentd server on your host, and (if not already) compile bip with oidentd spoofing support (--enable-oidentd option of the configure script). 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.0-rc3/NEWS0000644000175000017500000000504612442320231010375 000000000000002009-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-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. 09-12-2007: 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. 29-10-2007: 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. 02-09-2007: 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. bip-0.9.0-rc3/bip.conf.50000644000175000017500000003463213242620630011472 00000000000000.TH BIP.CONF 5 "23 February 2017" .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 \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. \fBbacklog_no_timestamp\fP (default: \fBfalse\fP) If true, backlogged line won't include the timestamp. .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 resetted 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 \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.0-rc3/scripts/0000755000175000017500000000000013256270234011453 500000000000000bip-0.9.0-rc3/scripts/bip-release0000744000175000017500000000313013242620630013476 00000000000000#!/bin/sh set -e if [ ! -d src ] ; 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 --enable-oidentd # 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 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.0-rc3/scripts/bipgenconfig0000744000175000017500000012444113055574160013761 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_no_timestamp' => { 'type' => 'b', 'adv' => 0, 'optional' => 1, 'default' => 'false', 'depends' => 'backlog', 'depval' => 'true', 'desc' => 'Disable timestamp in backlog ?' }, '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_no_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 ($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'}}) { $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.0-rc3/samples/0000755000175000017500000000000013256270234011430 500000000000000bip-0.9.0-rc3/samples/bip.conf0000644000175000017500000002305213242620630012765 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 /.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; # When true, disables time stamps if you find them ugly. #backlog_no_timestamp = false; # 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 = ""; # 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"; # 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 { # 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.0-rc3/samples/bip.vim0000644000175000017500000001311013051303063012621 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.0-rc3/bip.10000644000175000017500000000146113242620630010534 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.0-rc3/bipmkpw.10000644000175000017500000000100113242620630011421 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.0-rc3/systemd/0000755000175000017500000000000013252165163011454 500000000000000bip-0.9.0-rc3/systemd/bip-config.service0000644000175000017500000000047513242620630014773 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.0-rc3/systemd/bip.service0000644000175000017500000000065013242620630013523 00000000000000[Unit] Description=Bip IRC Proxy 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 != 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.0-rc3/systemd/README0000644000175000017500000000137713242620630012256 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.0-rc3/systemd/bip_env.sh0000744000175000017500000000240713242620630013350 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