From 762fc50ae0df1481645b3402c58b0cf30ccdca4d Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 09 2020 10:59:32 +0000 Subject: aide-0.16 base --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..bb44c28 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,18 @@ +If you have any questions about aide, it's use or applications please send +your inquiries to the mailing list at aide@cs.tut.fi rather than to the +individuals named below. + +The main authors of this package are: + * Rami Lehti (rammer@cs.tut.fi) + * Pablo Virolainen (pablo@ipi.fi) + +Other contributors (people who have given us code/patches): + * Peter Kelemen (peter.kelemen@cern.ch) + * Mike Markley (mike@markley.org) + * Steve Grubb (sgrubb@redhat.com) + +This package is currently maintained by: + * Richard van den Berg (richard@vdberg.org) + * Hannes von Haugwitz (hannes@vonhaugwitz.com) + +Thanks to the people who have given good bug reports. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..eeb586b --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) 19yy + + 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 + + +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) 19yy 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. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..263c438 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1088 @@ +2016-07-25 Hannes von Haugwitz + * Release version 0.16 + +2016-07-11 Hannes von Haugwitz + * Fix example aide.conf (xattr -> xattrs) + * aide.conf.5: update "SELECTION LINES" section + * Released version 0.16rc1 + +2016-07-10 Hannes von Haugwitz + * Fix compilation with latest libaudit + * Use AC_PROG_CC_C99 instead of AC_PROG_CC + * Add AM_PROG_CC_C_O + * aide.conf.in: logfile -> file + * Update README + * Update manual pages (aide.1 and aide.conf.5) + +2016-07-07 Hannes von Haugwitz + * Adapt manual to version 0.16 + +2016-06-08 Hannes von Haugwitz + * Add missing break statements + +2016-04-15 Hannes von Haugwitz + * Released version 0.16b1 + +2016-04-13 Hannes von Haugwitz + * Fix spelling errors + * Makefile.am: fix distribution of doc files + +2016-04-11 Hannes von Haugwitz + * Add 'report_ignore_changed_attrs' option, deprecate 'ignore_list' option + * Add 'report_force_attrs' option, deprecate 'report_attributes' + option + +2016-04-08 Hannes von Haugwitz + * Fix some compiler warnings + +2016-04-06 Hannes von Haugwitz + * Support restricted selection lines + +2016-04-02 Hannes von Haugwitz + * Adjust file type letters + +2016-03-31 Hannes von Haugwitz + * Change verbosity levels to ease debugging + +2016-03-28 Hannes von Haugwitz + * Fix '.*'-rule matching and code cleanup + +2016-03-22 Hannes von Haugwitz + * Fix compilation issue with e2fsprogs 1.43 + +2016-03-06 Hannes von Haugwitz + * Fix report layout + +2016-03-05 Hannes von Haugwitz + * Fix segfault when DB_CHECKINODE is used + +2016-03-02 Hannes von Haugwitz + * Add new '--limit' parameter + +2016-03-01 Hannes von Haugwitz + * Sort entries of database file + +2016-02-27 Hannes von Haugwitz + * Switch to Perl 5 Compatible Regular Expressions, changes include: + - require PCRE library + - drop bundled GNU regexp library + * src/commandconf.c: add warning if a group is redefined + +2016-02-21 Hannes von Haugwitz + * Add new 'database_add_metadata' option + +2016-02-20 Hannes von Haugwitz + * Add new 'report_quiet' option + +2015-11-22 Hannes von Haugwitz + * Use single Makefile.am + * doc/aide.conf.5.in: minor fixes + +2015-11-20 Hannes von Haugwitz + * src/gen_list.c: minor code cleanup + +2015-11-16 Hannes von Haugwitz + * Rewrote handling of ignored/forced attributes, changes include: + - new 'report_ignore_added_attrs' option + - new 'report_ignore_removed_attrs' option + - print human-readable info about ignored attributes in report + - code cleanup + - bug fixes + +2015-11-07 Hannes von Haugwitz + * Added new 'report_ignore_e2fsattrs' option + +2015-10-31 Hannes von Haugwitz + * src/gen_list.c: fixed bug if rules are removed + +2015-10-28 Hannes von Haugwitz + * src/compare_db.c: fixed total number of entries + +2015-08-08 Hannes von Haugwitz + * src/compare_db.c: added support for new e2fsattrs flags + +2015-05-06 Hannes von Haugwitz + * src/compare_db.c: adjusted report layout + +2015-03-02 Hannes von Haugwitz + * Renamed 'configure.in' to 'configure.ac' + +2013-05-20 Hannes von Haugwitz + * Print checksums of databases in verbose level 2 or higher (closes + feature request 1502032) + * Added new 'database_attrs' option + * configure.in: fixed compilation with selinux + * src/conf_lex.l, src/db_lex.l: fixed definition of YYDEBUG + +2013-05-18 Hannes von Haugwitz + * configure.in: removed check for 'libcrypt' + * Renamed 'detailed_init_report' option to 'report_detailed_init' + +2013-05-17 Hannes von Haugwitz + * configure.in: + - fixed "suspicious cache-id" warnings + - removed 'AC_CONFIG_MACRO_DIR' macro + * src/Makefile.am: + - replaced INCLUDES with AM_CPPFLAGS + +2013-05-16 Hannes von Haugwitz + * Handle tilde (~) in database paths and report urls + * src/compare_db.c: adjusted report layout + +2013-05-14 Hannes von Haugwitz + * src/db.c: fixed segfault when dbconf->db_out is NULL + * Replaced fopen.c with the version from curl-7.30.0 + +2013-05-08 Hannes von Haugwitz + * src/compare_db.c: + - fixed output of checksums + - use size_t as the type of for loop variable + +2013-05-06 Hannes von Haugwitz + * src/compare_db.c: + - fixed return value of database initialization + - minor code cleanup + * src/db_file.c, src/do_md.c: + - fixed use of unportable %m format + * doc/aide.1.in: + - fixed format in NOTES section + - documented return value of '--compare' and '--update' command + +2013-05-04 Hannes von Haugwitz + * src/compare_db.c: + - changed minimum verbose level for printing the details + about added and removed entries to 7 + * README: + - updated "Source Code Verification" section + * Released version 0.16a2 + +2012-10-10 Hannes von Haugwitz + * Added new default group X + * src/gen_list.c: fixed stripping of removed attributes + +2012-10-08 Hannes von Haugwitz + * src/gen_list.c: fixed handling of renamed files + - read in databases in one go + - read in old database at the end + +2012-10-06 Hannes von Haugwitz + * Added new report_base16 option + +2012-09-05 Hannes von Haugwitz + * src/compare_db.c: support older versions of e2fsprogs + +2012-06-19 Hannes von Haugwitz + * src/db_file.c: added missing format string to dofprintf calls + +2011-10-02 Hannes von Haugwitz + * Added new detailed_init_report option + +2011-09-29 Hannes von Haugwitz + * configure.in, include/aide.h, src/db_file.c: + - fixed 'undef' compiler warnings + +2011-09-24 Hannes von Haugwitz + * src/gen_list.c, include/do_md.h, src/do_md.c: + - moved selinux2line function to src/do_md.c + - moved xattrs2line function to src/do_md.c + * src/db_file.c: + - declare db_writeacl only if WITH_ACL is defined + +2011-09-23 Hannes von Haugwitz + * include/db_disk.h, src/db_disk.c, src/db.c: + - fixed 'unused-parameter' compiler warning + * include/db_disk.h, src/db_disk.c: + - removed unused functions (db_disk_read_spec, db_writespec_disk, + db_writeline_disk, db_close_disk) + * src/db_file.c: + - fixed 'unused-but-set-variable' compiler warnings + * src/gen_list.c, include/do_md.h, src/do_md.c: + - call acl2line only if WITH_ACL is defined + +2011-09-22 Hannes von Haugwitz + * src/be.c: + - declared static functions static + * src/commandconf.c: + - fixed 'unused-but-set-variable' compiler warning + * src/compare_db.c: + - fixed some 'format' compiler warnings + * src/db.c: + - fixed 'unused-but-set-variable' compiler warnings + +2011-09-21 Hannes von Haugwitz + * include/aide.h, src/aide.c: + - declared static functions static + +2011-09-20 Hannes von Haugwitz + * include/aide.h, src/db_file.c: + - fixed format of 8 bytes off_t type + +2011-09-17 Hannes von Haugwitz + * src/aide.c: + - added missing #include + +2011-09-09 Rami Lehti + * src/base64.c, src/gen_list.c: + - changed verbosity levels to ease debugging + +2011-09-07 Hannes von Haugwitz + * src/commandconf.c: + - added missing spaces to "Cannot access config file" message + +2011-09-05 Hannes von Haugwitz + * Added new root_prefix option + * src/do_md.c: + - removed unused function (md_init_fail) + +2011-09-04 Hannes von Haugwitz + * include/gen_list.h, src/gen_list.c: + - removed unused functions (add_file_to_list, traverse_tree, gen_list) + +2011-09-03 Hannes von Haugwitz + * src/gen_list.c: + - print list of added files (verbose level >= 2) and their details + (verbose level >= 6) if database has been initialized + +2011-07-12 Hannes von Haugwitz + * src/gen_list.c: + - fixed has_str_changed function + * src/util.c: + - fixed bad free of hostname variable + * src/db_file.c: + - removed dead code + +2011-04-08 Hannes von Haugwitz + * src/gen_list.c: + - fixed wrong total number of entries if comparing two databases + +2011-03-29 Hannes von Haugwitz + * src/compare_db.c: + - rewrote gen_report function, changes included: + - merged gen_report() and report_tree() + - added info about verbose level, ignorelist and report_attributes to + report if they differ from standard value + - changed report if aide found no changes + - added info about number of entries if aide found no changes or + the database has been initialized + - fixed report of added or removed entries if verbose level is 6 or + higher and there are only added or removed entries + +2011-03-24 Hannes von Haugwitz + * src/compare_db.c: + - made ignored_attrs and forced_attrs global + - added run time to report + +2011-03-22 Hannes von Haugwitz + * src/compare_db.c: + - print "End timestamp" message in report + +2011-03-18 Hannes von Haugwitz + * src/db_disk.c: + - fixed handling of "/" directory inode + - got rid of some static variables + +2011-03-01 Hannes von Haugwitz + * Removed contrib/mkgitsnapshot.sh + +2011-02-16 Hannes von Haugwitz + * Released version 0.16a1 + +2011-02-09 Hannes von Haugwitz + * README: + - adjusted "Source Code Verification" section + +2010-12-30 Hannes von Haugwitz + * src/compare_db.c: + - print "Looks okay" message also in DO_DIFF mode + +2010-12-29 Hannes von Haugwitz + * include/compare_db.h, src/compare_db.c: + - added gen_report function (code copied from src/aide.c) + * src/aide.c: + - removed code copied to src/compare_db.c + * include/compare_db.h: + - removed report_tree function + +2010-12-28 Hannes von Haugwitz + * src/compare_db.c: + - use strftime to format timestamps + - made width_details, time_format[] and time_string_len constant + - added numeric timezone to the date format + +2010-12-27 Hannes von Haugwitz + * src/compare_db.c: + - added xattrs2array, acl2array and get_attribute_values functions + - added print_dbline_attributes function, changes included: + - wrap attribute values instead of cut them off + - side-by-side output of acl and xattrs values + - use '|' to separate the old value from the new one + - use node->changed_attributes instead of recalculate the + changed attributes + - print added or removed attributes of changed entries if forced + via report_attributes + - removed obsolete code + - print details about added and removed entries in verbose level 6 + or higher, closes feature request 1460461 + - print added and removed attribute values of changed entries in + verbose level 6 or higher + +2010-12-26 Hannes von Haugwitz + * src/compare_db.c: + - fixed type of summary_char[] + - fixed typo in comment + +2010-11-27 Hannes von Haugwitz + * doc/aide.1.in: + - fixed format in FILES section + - added hint on how to decode base64 encoded checksums + +2010-11-26 Hannes von Haugwitz + * doc/manual.html: + - applied changes by Jack Blankenship + +2010-11-16 Hannes von Haugwitz + * src/compare_db.c: + - added missing declaration of aclt variable + +2010-11-14 Hannes von Haugwitz + * src/conf_yacc.y: + - fixed declaration of conftext variable + * configure.in: + - fixed compilation under Solaris + * README: + - added hint to use --disable-static under Solaris 10/OpenSolaris + +2010-10-12 Hannes von Haugwitz + * src/gen_list.c, src/do_md.c: + - replaced "File" by "Entry" + +2010-10-11 Hannes von Haugwitz + * src/aide.c, doc/aide.conf.5.in: + - enabled summarize_changes by default + +2010-09-29 Hannes von Haugwitz + * src/compare_db.c: + - rewrote summarize_changes feature to work with node->changed_attrs + - replaced "files" by "entries" + - made e2fsattrs2string static + - use S_IFMT to extract the file type code + +2010-09-27 Hannes von Haugwitz + * src/gen_list.c: + - added bytecmp, has_str_changed, has_md_changed, compare_single_acl, + has_acl_changed, cmp_xattr_node, have_xattrs_changed (copied and + renamed from src/compare_db.c) + - added get_changed_attributes function + - use get_changed_attributes instead of compare_dbline + - save changed attributes in node->changed_attrs + * include/compare_db.h, src/compare_db.c: + - removed obsolete compare_dbline function + +2010-09-24 Hannes von Haugwitz + * include/compare_db.h: removed init_rxlst function + * include/db_config.h: include seltree.h after #define DB_ATTR_TYPE + * include/seltree.h: + - use DB_ATTR_TYPE instead of int for attr + - added DB_ATTR_TYPE changed_attrs to seltree struct + +2010-09-23 Hannes von Haugwitz + * src/compare_db.c: + - removed unused functions (find_line_match, init_rxlst, eat_files_indir) + - compare ignorelist/forced_attrs with DB_ATTR_UNDEF instead of -1 + - renamed e2fsattrs2char function to e2fsattrs2string + - use str_has_changed instead of compare_str + - added debug output to md_has_changed + - use md_has_changed instead of compare_md_entries + - removed obsolete functions (compare_str, compare_md_entries) + +2010-09-17 Hannes von Haugwitz + * src/compare_db.c: fixed compiler warning if WITH_AUDIT is not defined + +2010-09-11 Hannes von Haugwitz + * Documented '-E' in man page and '--help' text + +2010-09-10 Richard van den Berg + * Released version 0.15.1 + * Changed version to post-0.15.1 + +2010-09-07 Hannes von Haugwitz + * Ignore changed file name if attributes does not match + * Allow absence of DB_CHECKINODE if file name has changed + +2010-08-08 Richard van den Berg + * Added mkgitsnapshot.sh to contrib/ + * Released version 0.15 + * Changed version to post-0.15 + +2010-08-06 Hannes von Haugwitz + * Updated copyright notices of list.h, list.c, md.h, md,c, symboltable.h, + symboltable.c, util.h and util.c + * Escaped '-' that really mean '-' in man pages + * Updated copyright notices of db_config.h, report.h, url.h, conf_yacc.y, + db_lex.l and error.c + +2010-08-05 Hannes von Haugwitz + * Updated copyright notices of db_file.h, db_file.c, db_sql.h, db_sql.c, + do_md.h, do_md.c, gen_list.h and gen_list.c + +2010-08-04 Hannes von Haugwitz + * Updated copyright notices of commandconf.h, commandconf.c, conf_lex.h, + conf_lex.l, db.h, db.c and db_list.h + +2010-08-03 Hannes von Haugwitz + * Updated copyright notices of aide.h, aide.c, be.c, compare_db.h, + compare_db.c and db_disk.c + +2010-08-02 Richard van den Berg + * Removed ], from version string when --with-curl was used, closes bug 3038382 + +2010-08-01 Richard van den Berg + * Released version 0.15-rc1 + * Changed version to post-0.15-rc1 + +2010-07-30 Hannes von Haugwitz + * Removed obsolete compare_db function + * Updated documentation of the default groups + +2010-07-29 Hannes von Haugwitz + * Added ftype and e2fsattrs to the default groups L, R and > + +2010-07-25 Hannes von Haugwitz + * Fixed sorting of files in report by filename + +2010-07-24 Hannes von Haugwitz + * Added new grouped option + * Sort files in report by filename, see feature request 1337718 + +2010-07-23 Hannes von Haugwitz + * Fixed indent of XAttrs output + * Fixed report_attributes for XAttrs + * Fixed indent of ACL output + * Fixed report_attributes for ACL + * Fixed report_attributes for Lname and SELinux + +2010-07-22 Hannes von Haugwitz + * Fixed report_attributes for checksum values + * Replaced 'E2fsAttrs' by 'E2FSAttrs' + * Fixed report_attributes for string and long values + * summarize_changes: made summary string length also for + added/removed files dynamic + +2010-07-21 Hannes von Haugwitz + * Fixed typo in aide.conf man page + * summarize_changes: made length of summary string dynamic + * Always save the inode to database (needed for DB_CHECKINODE) + * Documented ftype and e2fsattrs in aide.conf + * Added TFTYPE token + * Prompt for ./configure and make only if autoreconf was successful + +2010-07-20 Hannes von Haugwitz + * Added ext2 file attributes support + +2010-06-12 Hannes von Haugwitz + * Always add permissions attribute to database + * Added AIDEVERSION to report + +2010-06-11 Hannes von Haugwitz + * Adjusted old database warning message + +2010-06-10 Hannes von Haugwitz + * Added file type change detection support + * Use DB_ATTR_TYPE for ignorelist and forced_attrs + +2010-06-09 Hannes von Haugwitz + * Fixed handling of size and growing size bits + +2010-06-08 Hannes von Haugwitz + * Another fix for the changed permissions are always reported issue + +2010-06-07 Hannes von Haugwitz + * Replaced 'Permissions' by 'Perm' to fit 9 columns + * Fit detailed output in 80 columns, closes feature request 1337759 + +2010-06-05 Richard van den Berg + * Released version 0.14.2 + * Changed version to post-0.14.2 + +2010-06-05 Hannes von Haugwitz + * Added missing description for '|' in aide.conf man page + * Report correct file type in "Detailed information about changes" section + * Fixed strcpy issue on multi-core environments + +2010-06-04 Hannes von Haugwitz + * Replaced 'File' by 'Entry' in database warnings + * Reformatted "Entry ... has different attributes" warnings + +2010-06-03 Hannes von Haugwitz + * Added missing space and new line to "Error in selective regexp" message, + fixes bug 1944700 + * Added missing '-' to separator line in the report + +2010-05-30 Richard van den Berg + * Released version 0.14.1 + * Changed version to post-0.14.1 + +2010-05-20 Richard van den Berg + * Support spaces and other characters in file paths in config by Byron Darrah + * Added aide-attributes.sh script by Hannes von Haugwitz + +2010-05-19 Richard van den Berg + * Use exit() instead of abort() by Steve Grubb + * Fixed changed permissions are always reported issue by Hannes von Haugwitz + +2010-04-09 Richard van den Berg + * Use DB_ATTR_TYPE for compare_dbline() by Patrick Neely + +2010-03-27 Richard van den Berg + * Changed version to post-0.14 + * Do not use += in configure, fixes bug 2972100 + * Change gzdopen() from wb+ to wb, fixes bug 2976146 + * Do not strcat into uninitialized data, fixes bug 2919946 + * Add missing db_sql prototypes, and Sun Studio compatibility, fixes bug 2888035 + * Initialize gcrypt properly, fixes bug 2763470 + +2010-03-16 Richard van den Berg + * Released version 0.14 + +2010-02-26 Richard van den Berg + * Changed version to post-0.14-rc3 + * Fixed some AC_ARG_WITH magic + * Define ENOATTR if needed by Hannes von Haugwitz + +2010-02-25 Richard van den Berg + * Released version 0.14-rc2 + * Fix xattrs and selinux bits by Hannes von Haugwitz + * Released version 0.14-rc3 + +2010-02-25 Steve Grubb + * Additional checks for snprintf.c + * Fix off64_t and other size warnings + * Correct linker settings + +2010-02-24 Richard van den Berg + * Re-enable large file support on 32 bit systems by Steve Grubb + +2010-02-23 Richard van den Berg + * Show -D in --help by Steve Grubb + * Refix line->attr&DB_LINKNAME is always true issue by Hannes von Haugwitz + +2010-02-22 Richard van den Berg + * Released version 0.14-rc1 + * Changed version to post-0.14-rc1 + +2010-02-21 Richard van den Berg + * Replaced snprintf.c with the version from rsync-2.6.9 + +2010-02-21 Hannes von Haugwitz + * Fix checksums letter + * Always save the permission to database + * summarize_changes: Re-enabled file-type detection for removed files + * Fix line->attr&DB_LINKNAME is always true issue + * Remove localignorelist for changed nodes + * Disable DB_ACL bit if acls are not supported + +2010-02-18 Richard van den Berg + * Adjust building of fopen.c by Steve Grubb + * Fix error handling for prelink by Steve Grubb + +2010-02-17 Richard van den Berg + * Fix several warnings by Steve Grubb + * Check LD in configure by Steve Grubb + * Fix xattrs typos by Hannes von Haugwitz + * Reworked summarize_changes option by Hannes von Haugwitz + +2010-02-13 Richard van den Berg + * Added autoconf patch from Steve Grubb + * Removed AM_PROG_LIBTOOL from configure.in + +2010-02-06 Hannes von Haugwitz + * Fixed wrong char array size + +2010-02-01 Hannes von Haugwitz + * Added new option to summarize changes in output file + +2009-05-15 Richard van den Berg + * Prelink patch by Peter Vrabec + +2007-12-20 Richard van den Berg + * Fix equals matches, patch by Brian De Wolf + +2007-08-22 Richard van den Berg + * Turn CR/LF into LF, patch by Steve Conklin + +2007-06-05 Richard van den Berg + * Display complete selinux context, patch by Steve Conklin + +2007-05-15 Richard van den Berg + * Quit autogen.sh if required tools are not found + +2007-04-27 Richard van den Berg + * Only use optional groups in "make check" when enabled + * Prevent segfaults in db_write_byte_base64, patch from James Antill + * Fix aide.spec, patch by George Hansper + +2006-12-19 Richard van den Berg + * Do not warn about files not being directories + +2006-12-15 Richard van den Berg + * Released version 0.13.1 + * Changed version to post-0.13.1 + +2006-12-14 Richard van den Berg + * Use lseek() instead of fseek() on aide.db + +2006-12-13 Richard van den Berg + * Work around for error while reading gzipped aide.db files + +2006-12-08 Richard van den Berg + * Removed ustat dead code + +2006-12-07 Richard van den Berg + * Released version 0.13 + * Changed version to post-0.13 + +2006-11-30 Richard van den Berg + * Set meaningful exitcodes when --check is used (Pablo Virolainen) + +2006-11-29 Richard van den Berg + * Changed version to post-0.13-rc2 + * Check for WHIRLPOOL so old mhash can be used (Pablo Virolainen) + +2006-11-25 Richard van den Berg + * Fix error message about HAVAL and CRC32 with --update and gcrypt + * Fix --with and --without logic of configure + * Make --without switches of configure work + * Released version 0.13-rc2 + +2006-11-24 Richard van den Berg + * Remove stpcpy declaration because it is not defined in util.c + * Fix segfault when line->cntx is NULL + * Add --without-mhash to configure + * Don't use DB_SELINUX and DB_XATTR when not present + * Fix use of libgcrypt + * Add new group 'l' to detect changed link name + * Update documentation with new groups + * Supply strnlen in utils.c + * Released version 0.13-rc1 + +2006-11-15 Richard van den Berg + * Fix syslog URLs (Yves Mettier ) + +2006-10-30 Richard van den Berg + * Make --with-selinux work without pkg-config + +2006-10-27 Richard van den Berg + * Added "Add xattr support" patch from James Antill + * Added "report miscompares to Linux Audit System" patch from James Antill + * Added "Allow building without mhash library" patch from James Antill + * Added "correct db_names" patch from Steve Grubb + * Added "memory leaks and performance updates" patch from Steve Grubb + * Added "deadcode removal" patch from Steve Grubb + * Added "change K&R functions to void functions" patch from Steve Grubb + * Added "Memleak fix for ACLs, SELinux, XAttr" patch from James Antill + +2006-10-10 Richard van den Berg + * Added note about rpl_malloc on AIX 5.3 with mhash + * Include version.m4 in distribution tar file + * No need for absolute $(srcdir) in configure + * Use AC_CONFIG_FILES(files..) instead of AC_OUTPUT(files..) + * Removed redundant targets from Makefile.am + +2006-10-06 Richard van den Berg + * Changed version to post-0.12 + * Added file locking for output files + +2006-10-05 Richard van den Berg + * Released version 0.12 + +2006-10-04 Richard van den Berg + * Close database files earlier + * Released version 0.12-rc2 + +2006-09-24 Richard van den Berg + * Fixed filesize stored in postgres (SF bug #1177758) + +2006-07-15 Richard van den Berg + * Released version 0.12-rc1 + * Remove the use of NODE_ADD_CHILDREN, hopefully it is no longer needed + * Added syntax changed from 10-manpages.dpatch + * Added newlines as per SF bug #1461182 + * Added report_attributes group (Pablo Virolainen) + +2006-06-13 Richard van den Berg + * Fix stat type in report_tree() (Heiko Lehmann ) + +2006-05-31 Richard van den Berg + * Added support for posix_fadvice() (Pablo Virolainen) + +2006-04-22 Richard van den Berg + * Fix seg faults on OpenBSD (Axel Rau ) + +2006-04-22 Richard van den Berg + * Fix mmap on HPUX (fredrik@soderblom.org patch 1474555) + +2006-03-31 Richard van den Berg + * Abort if aide.db does not have checksum when FORCEDBMD is used + * Explain aide.conf and aide.db signing + +2006-03-29 Richard van den Berg + * Add spaces to error messages (Marc Haber) + * Don't warn about rules referring to non-existent directories by default + +2006-03-25 Richard van den Berg + * Allow aide.db to be supplied on stdin (Pablo Virolainen) + * Add patch to allow http/https/ftp URLs through libcurl (Pablo Virolainen) + +2006-03-17 Richard van den Berg + * Use system strnstr when available + * Add --disable-static flag to configure + +2006-03-13 Richard van den Berg + * Applied manual patch from Marc Haber + * Added note about problems with mhash 0.9.x + +2006-03-12 Richard van den Berg + * Mordernize use of AM_INIT_AUTOMAKE + * Use AIDEVERSION to avoid clash with VERSION of other packages + +2006-02-26 Richard van den Berg + * Use @sysconfdir@ as directory in aide.1, SF bug #1438995 + +2006-02-23 Richard van den Berg + * Set AIDEVERSION right after including config.h + * Added note about SIGTERM (Marc Haber) + +2006-02-18 Richard van den Berg + * Released version 0.11 + * Changed version to post-0.11 + +2006-02-14 Richard van den Berg + * Fix the broken @@ifhost and @@ifnhost directives by lcn2 (SF bug #1430482) + +2006-02-09 Richard van den Berg + * Fall back to strtoimax if strtoll is not available + * Protect against non existing syslog facilities + * Updated aide.spec.in as suggested in SF bug #1428576 + +2006-02-08 Richard van den Berg + * Explicitly check for readdir64, by Virolainen Pablo + * Added note about --disable-lfs in README + +2006-01-30 Richard van den Berg + * Released version 0.11-rc3 + * Changed version to post-0.11-rc3 + +2006-01-29 Richard van den Berg + * Fix layout of aide.conf.5 by Vincent Danen + * Cleanup --help output by Vincent Danen + * Add separators in --check output by Vincent Danen + * Add --disable-lfs option to configure + +2006-01-22 Richard van den Berg + * Allow report_url to change syslog facility + * Only warn when DB_CHECKINODE and DB_CTIME are used together + * Added GPG scripts by Vincent Danen + +2005-12-19 Richard van den Berg + * Revert check_list_for_match to old behaviour (Marc Haber) + * Documentation update (Marc Haber) + +2005-12-12 Richard van den Berg + * Log tree matching verbosely, patch by Virolainen Pablo + +2005-11-15 Richard van den Berg + * Applied 'allow removed files' patch by Virolainen Pablo + +2005-11-13 Richard van den Berg + * Applied fix to ANF by Virolainen Pablo + +2005-11-07 Richard van den Berg + * Applied 'allow new files' patch by Virolainen Pablo + +2005-11-03 Richard van den Berg + * Remove russian translations; they are out of date and there is no static version of gettext available + * Do not stop parsing directory at unescaped . + * Fix "make dist" and "make check" + * Added gpg scripts to contrib + * Released version 0.11-rc2 + * Changed version to post-0.11-rc2 + +2005-10-30 Richard van den Berg + * Warn if 'I' and 'c' are used together + +2005-10-28 Richard van den Berg + * Ignore 'c' when 'I' is in effect + * Mention in aide.conf.5 that 'c' and 'I' are incompatible + +2005-10-26 Richard van den Berg + * Check for ino64_t and dirent64 separately since HPUX does not have them + +2005-10-25 Richard van den Berg + * Print start and stop timestamp together (Marc Haber ) + * Print database_out path with -i and -u + * Added bzip2.sh to the contrib directory + +2005-10-19 Richard van den Berg + * Applied patch from Debian bug #121717: aide spelling fixes + +2005-10-16 Richard van den Berg + * Applied patch 1124758: fix underquoted m4 + * Applied patch 1124757: dist-hook missing file snprintf.h + * Applied patch 1124760: cleaner automake initialisation + * Applied patch 1124782: gettextize related patch + +2005-10-07 Richard van den Berg + * If open() with NO_ATIME fails, try open() again without it + +2005-10-05 Richard van den Berg + * Compile aide as a static executable + * Fixed some spelling errors caught by Marc Haber + * Changed version to Post 0.11-rc1 + * Ignore special characters after backslash in directory names (bug #1162575) + +2005-10-04 Richard van den Berg + * Released aide 0.11-rc1 + +2005-09-14 Richard van den Berg + * Print detailed error message when mmap() returns MAP_FAILED + +2005-09-02 Richard van den Berg + * Added patch for cygwin compatibility as per bug #1279818 + +2005-08-10 Richard van den Berg + * Open files with O_NOATIME on Linux (per Vlada Macek ) + +2005-08-08 Richard van den Berg + * Reset fs.st_rdev in 2 additional places as per bug #1253822 + +2005-06-30 Richard van den Berg + * Removed return in conf_lex.l that caused --after to be ignored + +2005-06-12 Richard van den Berg + * Applied another aide.1.in from Sven Hoexter + +2005-06-11 Richard van den Berg + * Applied aide.1.in patch from SF bug #1217483 + +2005-04-28 Richard van den Berg + * Added long long support for portable snprintf + * Created aide.conf.5.in and aide.conf.5.ru.in as per bug #1103719 + +2005-04-27 Richard van den Berg + * Fixed sshaide.sh as suggested in bug #1100740 + * Removed db_writeacl() from db_disk.c as suggested in bug #1143889 + * Set st_rdev to 0 when not used as suggested in bug #1169697 + +2005-04-18 Richard van den Berg + * Correctly parse multiple backslashes in file names + +2005-04-08 Richard van den Berg + * Use configure to define type for storage of file size in aide.db + * Applied fix suggested in Debian Bug #237969 + +2005-04-06 Richard van den Berg + * Always include aide.h before any other include file + * Include aide.h instead of config.h to avoid multiple inclusions + * Fixed large file under Solaris + * Make large file support generic (not just for Solaris) + +2005-04-05 Richard van den Berg + * Fixed bug where shrinking files with S set where not detected + +2005-02-20 Richard van den Berg + * Removed extra gen_tree() as suggested in patch 985632 + * Allow escaping of spaces in filenames (Virolainen Pablo ) + * Allow @@{HOSTNAME} usage in aide.conf (Virolainen Pablo ) + +2004-11-16 Richard van den Berg + * Applied patch 984424: bug fix for "--check recurses when it shouldn't" + * Applied patch 853842: sshaide - contributed script + +2004-11-12 Richard van den Berg + * Fixed patch from Virolainen Pablo + * Applied patch id 931224: Ignoring moved files + +2004-11-05 Richard van den Berg + * Applied patch from Virolainen Pablo to give more infomation when file attributes have changed before calculating the hash + +2004-11-04 Richard van den Berg + * Make sure readdir_r is POSIX compliant before we use it + +2004-11-03 Richard van den Berg + * Applied patch 1058973: Please don't add -I$(prefix)/include + * Fixed bug 836253: Manual is wrong about --check command + * Applied fix in config parser to avoid 10000 line limit + +2004-11-02 Richard van den Berg + * Fixed various documentation bugs filed as sf.net + +2004-10-29 Richard van den Berg + * Use syslog() for systems that do not have vsyslog() + * Fixed file system traversing bug for systems without readdir_r + * Fixed bug 836257: Line numbers in verbose output off by one + +2004-10-28 Richard van den Berg + * Removed config.h.in + * Added ISO C99 compliant snprintf for systems that do not have it + +2004-10-26 Richard van den Berg + * Added check for ISO C99 compliant vsnprintf to configure.in + +2004-10-23 Richard van den Berg + * Applied PSQL patch from Marc Giger + * Set version to "Post 0.10" + * Removed aide.1 and aide.1.ru since they are created by configure + * Moved #endif for WITH_MHASH in commandconf.c thanks to berkeley@octagon.com.au + +2003-12-08 Richard van den Berg + * Applied patch 853842 "sshaide - contributed script" + * Applied patch 855639 "Updated README file" + +2003-12-02 Richard van den Berg + * Fixed bug 851671 Aide-0.10 --config-check dumps core + +2003-11-28 Richard van den Berg + * Released aide version 0.10 + * Applied patch 849857 "cosmetic report fix" thanks to John Kristoff + +2003-11-25 Mike Markley + * Applied patch from bug 848664 "crash in db_input_wrapper (gzip)" thanks to Matt Kettler + +2003-11-04 Richard van den Berg + + * Fixed typo in compare_db.c, closes bug 836255 thanks to Michael Schwendt + * Applied patch 801860, fixes bug 801857 "=/$ gives segfault" thanks to Michael Schwendt + * Applied patch 803001 "Fix for some memory leaks" thanks to Michael Schwendt + * Applied patch 801853 "getopt optstring is wrong" thanks to Michael Schwendt + +2003-10-03 Richard van den Berg + + * Moved project over to http://sf.net/projects/aide + * Fixed problems in conf_yacc.y + * Gzip code now uses best (-9) compression + +2002-07-22 Rami Lehti + + * Fixed Unimplemented error message when conf md not compiled in + * Fixed error message about nonexistant files. + * Fixed --with-extra-includes --with-extra-libs handling (I hope) + * Fixed *stat handling + +2002-06-04 Rami Lehti + + * Released 0.9 + +2002-05-31 Rami Lehti + + * Fixed a bug in memory handling causing corrupt md's + * Added --without-mmap configure option + +2002-05-29 Rami Lehti + + * Updated version to 0.9 + * Fixed loads of bugs + * This file should be updated more often + * Added support for md checked config and db + * Updated Copyright notices + * Changed checking algorithm (threading here we come) + +2002-02-10 Rami Lehti + * Fixed loads and loads of bugs + * Added syslog backend + * Report format changed + * added lots of parameters see man page and configure --help + * added ACL support for SunOS 5.x (and compatibles) + * Released 0.8 (This is an unstable release) + +2000-04-27 Rami Lehti + + * Added static link flag checking + * Released 0.7 + +2000-04-13 Rami Lehti + + * Added linkname checking + * Removed mhash snefru and fixed haval + * Mhash 0.8.1 required. + +2000-02-08 Rami Lehti + * Changed version to 0.7 + +2000-02-08 Rami Lehti + + * Fixed core dump bug in compare_db + * Added warning when config has changed + * Released 0.6 + +2000-01-18 Virolainen Pablo + + * Handles config filename '-' as stdin. Manpage update. + +1999-12-30 Rami Lehti + + * Fixed compilation problem with glibc 2.1 + +1999-12-29 Rami Lehti + + * Finally fixed wrong md5 sums. + * Fixed nonprintable filename encoding. + * Fixed a huge memory leak. 16k per databaseline. + +1999-12-08 Pablo Virolainen + * Check for [acm]times beeing in future is done correctly now. + * blockcount will now be writen to database... + +1999-12-02 Pablo Virolainen + * Added warning if file's [acm]time is in future (gen_list.c) + +1999-11-25 Rami Lehti + + * Added support for unknown @@ tokens in databases + +1999-11-25 Pablo Virolainen + * Ignorelist for reports implemented. + * Block count added. It might be usefull with file with holes. + +1999-11-24 Pablo Virolainen + * Added '^' to first charaster of every regexpr + * Minor changes do_md.c + +1999-11-23 Rami Lehti + + * Fixed MHASH_COMPATIBILITY problem. Mhash library version 0.6.1 is + now required. + * Began tidying up the code so that both the internal and mhash + hashes can be used at the same time. + +1999-11-05 Pablo Virolainen + + * Fixed bug in tree traverce. Now works without permission check. + +1999-10-26 Rami Lehti + + * Added support for mhash library (done mostly by pablo) + * Fixed a --with-config-file bug in configure.in + * Fixed md bug when using internal functions + * Finally updated the Changelog + +1999-08-26 Rami Lehti + + * Fixed config file handling + +(Wed, 25 Aug 1999 11:03:34 (EET):rammer) +Changed: ChangeLog,configure.in + Upped version to 0.4 + +(Thu, 26 Aug 1999 16:36:14 (EET):rammer) +Changed: configure aide.conf.5 compare_db.c,gen_list.c,util.c + util.h,conf_lex.l + Fixed a bug in gen_seltree + Changed default behaviour of verbositylevel 5. + Now it prints the detailed info about changed files too. + Now on level 5 if a dir is added a warning is shown that + foo files were added under the previous dir and not the files + themselves. On level 20 the behaviour is still the same. + +--------------------- + + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2099840 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..4b05d7a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,81 @@ +# +# aide, Advanced Intrusion Detection Environment +# +# 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; see the file COPYING. If not, write to +# the Free Software Foundation, 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +BUILT_SOURCES = src/conf_yacc.h +AM_YFLAGS= -d + +LEX_OUTPUT_ROOT = lex.yy + +bin_PROGRAMS = aide +aide_SOURCES = src/aide.c include/aide.h \ + include/base64.h src/base64.c \ + include/be.h src/be.c \ + include/commandconf.h src/commandconf.c \ + include/compare_db.h src/compare_db.c \ + include/conf_lex.h src/conf_lex.l \ + src/conf_yacc.h src/conf_yacc.y \ + include/db.h src/db.c \ + include/db_config.h \ + include/db_disk.h src/db_disk.c \ + include/db_file.h src/db_file.c \ + src/db_lex.l \ + include/db_list.h src/db_list.c \ + include/db_sql.h src/db_sql.c \ + include/do_md.h src/do_md.c \ + include/report.h src/error.c \ + include/gen_list.h src/gen_list.c \ + src/getopt1.c \ + include/getopt.h src/getopt.c \ + include/list.h src/list.c \ + include/locale-aide.h \ + include/md.h src/md.c \ + src/snprintf.c \ + include/seltree.h \ + include/symboltable.h src/symboltable.c \ + include/types.h \ + include/url.h \ + include/util.h src/util.c +if USE_CURL +aide_SOURCES += include/fopen.h src/fopen.c +endif + +aide_LDADD = -lm @PCRELIB@ @CRYPTLIB@ @ACLLIB@ @SELINUXLIB@ @AUDITLIB@ @ATTRLIB@ @E2FSATTRSLIB@ @ELFLIB@ +AM_CFLAGS = @AIDE_DEFS@ -W -Wall -g +AM_CPPFLAGS = -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src + +CLEANFILES = src/conf_yacc.h src/conf_yacc.c src/conf_lex.c src/db_lex.c + +man_MANS = doc/aide.1 doc/aide.conf.5 + +EXTRA_DIST = $(man_MANS) Todo doc/manual.html \ + contrib/bzip2.sh contrib/gpg2_check.sh contrib/gpg2_update.sh \ + contrib/gpg_check.sh contrib/gpg_update.sh contrib/sshaide.sh \ + contrib/aide-attributes.sh + +src/conf_yacc.c: src/conf_yacc.y + $(YACC) $(AM_YFLAGS) -o $@ -p conf $< + +src/conf_lex.c: src/conf_lex.l src/conf_yacc.c + $(LEX) $(AM_LFLAGS) -o$@ -Pconf $< + +src/db_lex.c: src/db_lex.l src/conf_yacc.h + $(LEX) $(AM_LFLAGS) -o$@ -Pdb $< diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..ff88176 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1106 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# aide, Advanced Intrusion Detection Environment +# +# 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; see the file COPYING. If not, write to +# the Free Software Foundation, 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = aide$(EXEEXT) +@USE_CURL_TRUE@am__append_1 = include/fopen.h src/fopen.c +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = doc/aide.conf doc/aide.1 doc/aide.conf.5 \ + aide.spec +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man5dir)" +PROGRAMS = $(bin_PROGRAMS) +am__aide_SOURCES_DIST = src/aide.c include/aide.h include/base64.h \ + src/base64.c include/be.h src/be.c include/commandconf.h \ + src/commandconf.c include/compare_db.h src/compare_db.c \ + include/conf_lex.h src/conf_lex.l src/conf_yacc.h \ + src/conf_yacc.y include/db.h src/db.c include/db_config.h \ + include/db_disk.h src/db_disk.c include/db_file.h \ + src/db_file.c src/db_lex.l include/db_list.h src/db_list.c \ + include/db_sql.h src/db_sql.c include/do_md.h src/do_md.c \ + include/report.h src/error.c include/gen_list.h src/gen_list.c \ + src/getopt1.c include/getopt.h src/getopt.c include/list.h \ + src/list.c include/locale-aide.h include/md.h src/md.c \ + src/snprintf.c include/seltree.h include/symboltable.h \ + src/symboltable.c include/types.h include/url.h include/util.h \ + src/util.c include/fopen.h src/fopen.c +am__dirstamp = $(am__leading_dot)dirstamp +@USE_CURL_TRUE@am__objects_1 = src/fopen.$(OBJEXT) +am_aide_OBJECTS = src/aide.$(OBJEXT) src/base64.$(OBJEXT) \ + src/be.$(OBJEXT) src/commandconf.$(OBJEXT) \ + src/compare_db.$(OBJEXT) src/conf_lex.$(OBJEXT) \ + src/conf_yacc.$(OBJEXT) src/db.$(OBJEXT) src/db_disk.$(OBJEXT) \ + src/db_file.$(OBJEXT) src/db_lex.$(OBJEXT) \ + src/db_list.$(OBJEXT) src/db_sql.$(OBJEXT) src/do_md.$(OBJEXT) \ + src/error.$(OBJEXT) src/gen_list.$(OBJEXT) \ + src/getopt1.$(OBJEXT) src/getopt.$(OBJEXT) src/list.$(OBJEXT) \ + src/md.$(OBJEXT) src/snprintf.$(OBJEXT) \ + src/symboltable.$(OBJEXT) src/util.$(OBJEXT) $(am__objects_1) +aide_OBJECTS = $(am_aide_OBJECTS) +aide_DEPENDENCIES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/ylwrap +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +SOURCES = $(aide_SOURCES) +DIST_SOURCES = $(am__aide_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__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 = $(man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/aide.spec.in \ + $(srcdir)/config.h.in $(top_srcdir)/doc/aide.1.in \ + $(top_srcdir)/doc/aide.conf.5.in \ + $(top_srcdir)/doc/aide.conf.in AUTHORS COPYING ChangeLog \ + INSTALL NEWS README compile config.guess config.sub depcomp \ + install-sh missing src/conf_lex.c src/conf_yacc.c \ + src/conf_yacc.h src/db_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 +ACLLIB = @ACLLIB@ +ACLOCAL = @ACLOCAL@ +AIDE_DEFS = @AIDE_DEFS@ +AIDE_USE_LOCALE = @AIDE_USE_LOCALE@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +ATTRLIB = @ATTRLIB@ +AUDITLIB = @AUDITLIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPTLIB = @CRYPTLIB@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +E2FSATTRSLIB = @E2FSATTRSLIB@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ELFLIB = @ELFLIB@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = lex.yy +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRELIB = @PCRELIB@ +PKG_CONFIG = @PKG_CONFIG@ +PSQLLIB = @PSQLLIB@ +RANLIB = @RANLIB@ +SELINUXLIB = @SELINUXLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +curlconfig = @curlconfig@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +BUILT_SOURCES = src/conf_yacc.h +AM_YFLAGS = -d +aide_SOURCES = src/aide.c include/aide.h include/base64.h src/base64.c \ + include/be.h src/be.c include/commandconf.h src/commandconf.c \ + include/compare_db.h src/compare_db.c include/conf_lex.h \ + src/conf_lex.l src/conf_yacc.h src/conf_yacc.y include/db.h \ + src/db.c include/db_config.h include/db_disk.h src/db_disk.c \ + include/db_file.h src/db_file.c src/db_lex.l include/db_list.h \ + src/db_list.c include/db_sql.h src/db_sql.c include/do_md.h \ + src/do_md.c include/report.h src/error.c include/gen_list.h \ + src/gen_list.c src/getopt1.c include/getopt.h src/getopt.c \ + include/list.h src/list.c include/locale-aide.h include/md.h \ + src/md.c src/snprintf.c include/seltree.h \ + include/symboltable.h src/symboltable.c include/types.h \ + include/url.h include/util.h src/util.c $(am__append_1) +aide_LDADD = -lm @PCRELIB@ @CRYPTLIB@ @ACLLIB@ @SELINUXLIB@ @AUDITLIB@ @ATTRLIB@ @E2FSATTRSLIB@ @ELFLIB@ +AM_CFLAGS = @AIDE_DEFS@ -W -Wall -g +AM_CPPFLAGS = -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src + +CLEANFILES = src/conf_yacc.h src/conf_yacc.c src/conf_lex.c src/db_lex.c +man_MANS = doc/aide.1 doc/aide.conf.5 +EXTRA_DIST = $(man_MANS) Todo doc/manual.html \ + contrib/bzip2.sh contrib/gpg2_check.sh contrib/gpg2_update.sh \ + contrib/gpg_check.sh contrib/gpg_update.sh contrib/sshaide.sh \ + contrib/aide-attributes.sh + +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .l .o .obj .y +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__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: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +doc/aide.conf: $(top_builddir)/config.status $(top_srcdir)/doc/aide.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doc/aide.1: $(top_builddir)/config.status $(top_srcdir)/doc/aide.1.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doc/aide.conf.5: $(top_builddir)/config.status $(top_srcdir)/doc/aide.conf.5.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +aide.spec: $(top_builddir)/config.status $(srcdir)/aide.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +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/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/aide.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/base64.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/be.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/commandconf.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/compare_db.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/conf_lex.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/conf_yacc.h: src/conf_yacc.c + @if test ! -f $@; then rm -f src/conf_yacc.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/conf_yacc.c; else :; fi +src/conf_yacc.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/db.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/db_disk.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/db_file.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/db_lex.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/db_list.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/db_sql.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/do_md.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/error.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/gen_list.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/getopt1.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/getopt.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/list.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/md.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/snprintf.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/symboltable.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/util.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/fopen.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +aide$(EXEEXT): $(aide_OBJECTS) $(aide_DEPENDENCIES) $(EXTRA_aide_DEPENDENCIES) + @rm -f aide$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aide_OBJECTS) $(aide_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)/aide.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/base64.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/be.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/commandconf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/compare_db.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/conf_lex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/conf_yacc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db_disk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db_file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db_lex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/db_sql.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/do_md.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gen_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/getopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/md.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/snprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/symboltable.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: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(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='$(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: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man5dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.5[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) + +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) | GZIP=$(GZIP_ENV) gzip -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) | GZIP=$(GZIP_ENV) gzip -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*) \ + GZIP=$(GZIP_ENV) gzip -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*) \ + GZIP=$(GZIP_ENV) gzip -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) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; 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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -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_lex.c + -rm -f src/conf_yacc.c + -rm -f src/conf_yacc.h + -rm -f src/db_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-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-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-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-man uninstall-man1 uninstall-man5 + +.PRECIOUS: Makefile + + +src/conf_yacc.c: src/conf_yacc.y + $(YACC) $(AM_YFLAGS) -o $@ -p conf $< + +src/conf_lex.c: src/conf_lex.l src/conf_yacc.c + $(LEX) $(AM_LFLAGS) -o$@ -Pconf $< + +src/db_lex.c: src/db_lex.l src/conf_yacc.h + $(LEX) $(AM_LFLAGS) -o$@ -Pdb $< + +# 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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..f81eafa --- /dev/null +++ b/NEWS @@ -0,0 +1,153 @@ +Version 0.16 (NOT_YET_RELEASED) + * BACKWARDS INCOMPATIBLE CHANGES: + - Negative selection lines of the form '! ' are no + longer supported (use '!' instead) + - The switch to Perl 5 Compatible Regular Expressions and the fix of + '.*'-rule matching may result in different rule matching behaviour + * Support restricted selection lines + * Switch to PCRE library (drops bundled GNU regexp library) + * New config options: + - database_add_metadata + - database_attrs + - report_base16 + - report_detailed_init + - report_force_attrs (deprecates report_attributes) + - report_ignore_added_attrs + - report_ignore_removed_attrs + - report_ignore_changed_attrs (deprecates ignore_list) + - report_ignore_e2fsattrs + - report_quiet + - root_prefix + * New '--limit' parameter + * Report changes: + - enable summarize_changes by default + - use '|' to separate the old value from the new one + - wrap attribute values instead of cut them off + - side-by-side output of acl and xattrs values + - adjust file type letters in summarize_changes output + - add numeric timezone to time string + - add info about verbose level to report if it differs from standard + value + - add info about number of entries if aide found no changes or + the database has been initialized + - add run time to report + - print "End timestamp" message in report + - print human-readable info about ignored and forced attributes in report + - print checksums of databases in verbose level 2 or higher + - print added and removed attribute values of changed entries in + verbose level 6 or higher + - print details about added and removed entries in verbose level 7 + or higher + - print added or removed attributes of changed entries if forced via + report_force_attrs + * New default group: X + * Fix '.*'-rule matching + * Handle tilde (~) in database paths and report urls + * Sort entries of database file + * Compare database entries just once + * Add warning if a group is redefined + * Update documentation + * Bug fixes + * Code clean up + +Version 0.15.1 + * Fixed bug with DB_CHECKINODE + +Version 0.15 + * Added new grouped option + * Sort files in report by filename + * Added support for e2fsattrs attribute + * Added support for ftype attribute + * Bug fixes + +Version 0.14.2 + * Report correct file type in "Detailed information + about changes" section + * Bug fixes + +Version 0.14.1 + * Added aide-attributes.sh contrib script + * Bug fixes + +Version 0.14 + * Renewed autoconf mechanism + * Resolved licensing conflicts + * New feature to summarize changes + * Added prelink support + * Many bugfixes + +Version 0.13.1 + * Fixed bug with reading gzipped aide.db files + * Removed dead ustat code + +Version 0.13 + * Added support for selinux and xattr attributes + (kindly contributed by Red Hat) + * Added support for the Linux Audit System + (kindly contributed by Red Hat) + * Fixed usage of libgcrypt instead of libmhash + * Added file locking for output files + * Fixed bugs + +Version 0.12 + * Fixed bugs + * Allow http/https/ftp URLs through libcurl + * Support posix_fadvice() to avoid caching files + +Version 0.11 + * Fixed many bugs + * Updated automake/autoconf scripts + * Use snprintf by Mark Martinec if not in C library + * Support for more (legacy) Unix systems and cygwin + * Open files with O_NOATIME on supported Linux systems + * Added I/ANF/ARF directives + +Version 0.10 + * Fixed bugs + * Moved project over to sourceforge.net + * Change of project ownership + +Version 0.9 + * Fixed bugs + * Added support for keyed md check of db and config + * Removed dependancy on libgcrypt + * Added dependancy on mhash + +Version 0.8 + * Fixed loads and loads of bugs + * Added syslog backend + * Report format changed + * added lots of parameters see man page and configure --help + * added ACL support for SunOS 5.x (and compatibles) + * libgcrypt is now separate and required + +Version 0.7 + * Bug fixes + * Compressed database support + * Linkname checking + * Mhash support (version 0.8.1 of mhash required) + +Version 0.6 + * Bug fixes + * Mhash support fixed + * MD sums fixed for now + +Version 0.5 + * Bug fixes + * ignore_list support + * Mhash library support (version 0.6.1 of mhash required) + * Disclaimer notices + +Version 0.4 + * Bug fixes + +Version 0.3 + * Added --update command + * some bugfixes +Version 0.2 + * Bugfix release +Version 0.1 + * Implemented lots of stuff +Version 0.0.0.1 + * Nothing yet + diff --git a/README b/README new file mode 100644 index 0000000..ce99155 --- /dev/null +++ b/README @@ -0,0 +1,168 @@ + + AIDE - Advanced Intrusion Detection Environment + ------------------------------------------------- + Version 0.16 + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extend permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + + Introduction + ------------ + + AIDE is a tool for monitoring file system changes. It can be used + to detect unauthorized monitored files and directories. AIDE was + written to be a simple and free alternative to Tripwire. Features + currently included in AIDE are as follows: + + o File attributes monitored: perissions, inode, user, group + file size, mtime, atime, ctime, links and growing size. + o Checksums and hashes supported: SHA1, MD5, RMD160, and TIGER. + CRC32, HAVAL and GOST if Mhash support is compiled in. + o Plain text configuration files and database for simplicity. + o Rules, variables and macros that can be customized to local + site or system policies. + o Powerful regular expression support to selectively include or + exclude files and directories to be monitored. + o gzip database compression if zlib support is compiled in. + o Stand alone static binary for easy client/server monitoring + configurations. + o Free software licensed under the GNU General Public License. + + + Current Version + --------------- + + AIDE is currently maintained on the SourceForge. Details of the + latest version of AIDE can be found on the server project page under + http://sourceforge.net/projects/aide/. + + Documentation + ------------- + + The documentation for AIDE can be found in the doc/ directory. The + most up-to-date documentation an be found on the SourceForge project + web site. + + Installation + ------------ + For generic instructions please see the INSTALL file. + + For AIX 5.3 it has been reported there is a problem with using mhash + which causes an "Undefined symbol: .rpl_malloc" error. This is a problem + in mhash_config.h which can be fixed by removing the line that reads + #define malloc rpl_malloc + + For Mac OS X Darwin/Leopard (10.4/10.5) and Solaris 10/OpenSolaris you need + to use --disable-static when configuring AIDE. Please note that dynamic + linking introduces a security risk and is not recommended. + + Since Mac OS Leopard (10.5) you also need to use --disable-lfs because it + handles 64 bit file support out of the box. + + Source Code Verification + ------------------------ + + We highly recommend checking that the version of AIDE downloaded and + installed is an original and unmodified one. You can either verify the + source tarball or the git tag. + + To check the supplied signature with GnuPG: + + $ gpg --verify aide-.tar.gz.asc + + This checks that the detached signature file is indeed a signature + of aide-.tar.gz. + + To validate the gpg signature of the git tag: + + $ git verify-tag v + + The current public key needed for signature verification is: + + pub 4096R/68E7B931 2011-06-28 [expires: 2021-06-27] + uid Hannes von Haugwitz + + If you do not have this key, you can get it from one of the well known PGP + key servers. You have to make sure that the key you install is not a faked + one. You can do this with reasonable assurance by comparing the output of: + + $ gpg --fingerprint 0x68E7B931 + + with the fingerprint published elsewhere. + + Requirements + ------------ + + AIDE requires the following development tools: + + o C compiler (such as Gcc). + o GNU flex. + o GNU yacc (bison). + o GNU make. + o PCRE library + o Mhash (optional, but highly recommended). Mhash is currently + available from http://mhash.sourceforge.net/. A static version of + libmhash needs to be build using the --enable-static=yes + configure option. + Aide requires at least mhash version 0.9.2 + + Note: + flex version 2.5.31 is broken, you might see the following error + + conf_lex.c: In function `conflex': + conf_lex.c:4728: error: `yy_prev_more_offset' undeclared (first use in + this function) + conf_lex.c:4728: error: (Each undeclared identifier is reported only once + conf_lex.c:4728: error: for each function it appears in.) + + Either downgrade to flex 2.5.4 or get an updated version that fixes + this bug. See also: + http://sourceforge.net/tracker/index.php?func=detail&aid=866477&group_id=72099&atid=533377 + http://sourceforge.net/mailarchive/message.php?msg_id=5415848 + http://sourceforge.net/mailarchive/message.php?msg_id=5561246 + + Large File Support + ----------------- + + To be able to store the size of files larger than 2GB, aide needs + large file support (LFS) to be available in the OS. The configure + script automatically checks for the correct defines and functions. + If configure fails, and during compile time you see errors containing + the number 64, try configure again with the --disable-lfs option. + This turns off the large file support. + + Cross Compilation + ----------------- + When cross compiling, manually verify the data types defines in config.h + as they cannot be accurately determined by configure. Most notably, + AIDE_INO_TYPE will be set to "cross". + + Feedback and Support + -------------------- + + End user support is available on the AIDE mailing list. To subscribe, + send a message to majordomo@cs.tut.fi with an empty Subject: line and + the following text as the BODY of the message: + + subscribe aide + + An archive for the mailing list archive is available online: + + http://www.mail-archive.com/aide@cs.tut.fi/ + + To report bugs, contribute patches and contact the current team of + developers, visit the SourceForge project web site for additional info: + + http://sourceforge.net/projects/aide/ + + + Credits + ------- + + Please see the AUTHORS file. diff --git a/Todo b/Todo new file mode 100644 index 0000000..7cf1b2b --- /dev/null +++ b/Todo @@ -0,0 +1,14 @@ +Planned Features and TODO list: +Multiple database retrieval backends +Encrypted databases +Return Codes +Email report +More elaborate report options +Recurse=n +Interactive db update +Is file really deleted or has the config changed. +Rewrite for smaller memory footprint. +Localization +Relative paths in databases +Checksum of the binary at the start of the report +@@ifdef foo || ( bar && baz ) diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..1b0489c --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,49 @@ +dnl Local aide macros + +dnl AIDE_LINK_FILES( SRC, DEST ) +dnl same as AC_LINK_FILES, but collect the files to link in +dnl some special variables and do the link +dnl when AIDE_DO_LINK_FILES is called +dnl This is a workaround for AC_LINK_FILES, because it does not work +dnl correct when using a caching scheme +dnl +define(AIDE_LINK_FILES, + [ if test "x$wk_link_files_src" = "x"; then + wk_link_files_src="$1" + wk_link_files_dst="$2" + else + wk_link_files_src="$wk_link_files_src $1" + wk_link_files_dst="$wk_link_files_dst $2" + fi + ]) + +define(AIDE_DO_LINK_FILES, + [ AC_LINK_FILES( $wk_link_files_src, $wk_link_files_dst ) + ]) + +dnl AIDE_MSG_PRINT(STRING) +dnl print a message +dnl +define(AIDE_MSG_PRINT, + [ echo $ac_n "$1"" $ac_c" 1>&AC_FD_MSG + ]) + +AC_DEFUN([AIDE_CHECK_READDIR_R_ARGS],[ +# Check definition of readdir_r +AC_CACHE_CHECK(args to readdir_r, aide_cv_readdir_r, +AC_TRY_LINK( +[#ifndef SCO +#define _REENTRANT +#endif +#define _POSIX_PTHREAD_SEMANTICS +#include +#include ], +[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); +readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ], +aide_cv_readdir_r=POSIX, aide_cv_readdir_r=other)) +if test "$aide_cv_readdir_r" = "POSIX" +then + AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have the `readdir_r' function.]) +fi +]) + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..322b108 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1182 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# -*- Autoconf -*- +# Obsolete and "removed" macros, that must however still report explicit +# error messages when used, to smooth transition. +# +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([AM_CONFIG_HEADER], +[AC_DIAGNOSE([obsolete], +['$0': this macro is obsolete. +You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl +AC_CONFIG_HEADERS($@)]) + +AC_DEFUN([AM_PROG_CC_STDC], +[AC_PROG_CC +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc +AC_DIAGNOSE([obsolete], +['$0': this macro is obsolete. +You should simply use the 'AC][_PROG_CC' macro instead. +Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', +but upon 'ac_cv_prog_cc_stdc'.])]) + +AC_DEFUN([AM_C_PROTOTYPES], + [AC_FATAL([automatic de-ANSI-fication support has been removed])]) +AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/aide.spec.in b/aide.spec.in new file mode 100644 index 0000000..a24f241 --- /dev/null +++ b/aide.spec.in @@ -0,0 +1,61 @@ +%define name aide +%define ver @AIDEVERSION@ +%define rel 1 +%define prefix /usr + +Summary: Advanced Intrusion Detection Environment +Name: %name +Version: %ver +Release: %rel +Copyright: GPL +Group: Console/Security +Source: http://prdownloads.sourceforge.net/aide/aide-%ver.tar.gz +BuildRoot: /var/tmp/aide-%{PACKAGE_VERSION}-root +Obsoletes: %name +URL: http://sourceforge.net/projects/aide +Docdir: %{prefix}/doc + +%description +aide is an intrusion detection system for checking the integrity of files. + +%changelog + +* Fri Nov 28 2003 Richard van den Berg + +- Changed URLs to point to sourceforge.net + +* Wed Jan 26 2000 Matthew Kirkwood + +- Fixes for RH 6.1 and sysconfdir changed to /etc and /var/lib/aide added + +* Sun Sep 12 1999 Rami Lehti + +- Some small changes to make this autogeneratable by configure. + +* Sat Sep 11 1999 Zach Brown + +- First go + +%prep +%setup + +%build +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --sysconfdir=/etc --with-config-file=/etc/aide.conf + +%install +rm -rf $RPM_BUILD_ROOT + +make prefix=$RPM_BUILD_ROOT%{prefix} install-strip install-man +mkdir -p -m700 $RPM_BUILD_ROOT/var/lib/aide + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) + +%doc AUTHORS COPYING ChangeLog NEWS README README-snprintf LICENSE-snprintf.txt Todo doc/aide* +%{prefix}/bin/aide +%{_mandir}/man1/aide.1* +%{_mandir}/man5/aide.conf.5* +/var/lib/aide diff --git a/compile b/compile new file mode 100755 index 0000000..a85b723 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /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: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..0967f2a --- /dev/null +++ b/config.guess @@ -0,0 +1,1454 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-04-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..51d3993 --- /dev/null +++ b/config.h.in @@ -0,0 +1,406 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Compile-time options displayed in -v output */ +#undef AIDECOMPILEOPTIONS + +/* package version */ +#undef AIDEVERSION + +/* blkcnt_t */ +#undef AIDE_BLKCNT_TYPE + +/* dirent */ +#undef AIDE_DIRENT_TYPE + +/* fstat */ +#undef AIDE_FSTAT_FUNC + +/* syslog ident */ +#undef AIDE_IDENT + +/* ino_t */ +#undef AIDE_INO_TYPE + +/* syslog logopt */ +#undef AIDE_LOGOPT + +/* lstat */ +#undef AIDE_LSTAT_FUNC + +/* off_t */ +#undef AIDE_OFF_TYPE + +/* readdir */ +#undef AIDE_READDIR_FUNC + +/* readdir_r */ +#undef AIDE_READDIR_R_FUNC + +/* stat */ +#undef AIDE_STAT_FUNC + +/* stat type */ +#undef AIDE_STAT_TYPE + +/* syslog facility */ +#undef AIDE_SYSLOG_FACILITY + +/* big endian */ +#undef BIG_ENDIAN_HOST + +/* HMAC key 00 */ +#undef CONFHMACKEY_00 + +/* HMAC key 01 */ +#undef CONFHMACKEY_01 + +/* HMAC key 02 */ +#undef CONFHMACKEY_02 + +/* HMAC key 03 */ +#undef CONFHMACKEY_03 + +/* HMAC key 04 */ +#undef CONFHMACKEY_04 + +/* HMAC key 05 */ +#undef CONFHMACKEY_05 + +/* HMAC key 06 */ +#undef CONFHMACKEY_06 + +/* HMAC key 07 */ +#undef CONFHMACKEY_07 + +/* HMAC key 08 */ +#undef CONFHMACKEY_08 + +/* HMAC key 09 */ +#undef CONFHMACKEY_09 + +/* hash type for config file check */ +#undef CONFIGHMACTYPE + +/* Location of configuration file */ +#undef CONFIG_FILE + +/* DB HMAC key 00 */ +#undef DBHMACKEY_00 + +/* DB HMAC key 01 */ +#undef DBHMACKEY_01 + +/* DB HMAC key 02 */ +#undef DBHMACKEY_02 + +/* DB HMAC key 03 */ +#undef DBHMACKEY_03 + +/* DB HMAC key 04 */ +#undef DBHMACKEY_04 + +/* DB HMAC key 05 */ +#undef DBHMACKEY_05 + +/* DB HMAC key 06 */ +#undef DBHMACKEY_06 + +/* DB HMAC key 07 */ +#undef DBHMACKEY_07 + +/* DB HMAC key 08 */ +#undef DBHMACKEY_08 + +/* DB HMAC key 09 */ +#undef DBHMACKEY_09 + +/* hash type for checking db */ +#undef DBHMACTYPE + +/* Default location of signature database */ +#undef DEFAULT_DB + +/* Default output location for newly-generated signature database */ +#undef DEFAULT_DB_OUT + +/* don't force config checksum */ +#undef FORCECONFIGMD + +/* don't force database checksum */ +#undef FORCEDBMD + +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* Define to 1 if the system has the type `byte'. */ +#undef HAVE_BYTE + +/* snprintf is ISO C99 compliant */ +#undef HAVE_C99_SNPRINTF + +/* vsnprintf is ISO C99 compliant */ +#undef HAVE_C99_VSNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CURL_CURL_H + +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `audit' library (-laudit). */ +#undef HAVE_LIBAUDIT + +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ +#undef HAVE_LIBGCRYPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the `pq' library (-lpq). */ +#undef HAVE_LIBPQ + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if the type `long double' works and has more range or precision + than `double'. */ +#undef HAVE_LONG_DOUBLE + +/* Define to 1 if the type `long double' works and has more range or precision + than `double'. */ +#undef HAVE_LONG_DOUBLE_WIDER + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* mhash has whirlpool */ +#undef HAVE_MHASH_WHIRLPOOL + +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* have off64_t */ +#undef HAVE_OFF64_T + +/* Define to 1 if you have the O_NOATIME flag. */ +#undef HAVE_O_NOATIME + +/* Define to 1 if you have the `posix_fadvise' function. */ +#undef HAVE_POSIX_FADVISE + +/* Define to 1 if you have the `readdir' function. */ +#undef HAVE_READDIR + +/* Define to 1 if you have the `readdir_r' function. */ +#undef HAVE_READDIR_R + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* 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 `stricmp' function. */ +#undef HAVE_STRICMP + +/* 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 `strnlen' function. */ +#undef HAVE_STRNLEN + +/* Define to 1 if you have the `strnstr' function. */ +#undef HAVE_STRNSTR + +/* Define to 1 if you have the `strtoimax' function. */ +#undef HAVE_STRTOIMAX + +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* syslog available? */ +#undef HAVE_SYSLOG + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_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_TYPES_H + +/* Define to 1 if the system has the type `u16'. */ +#undef HAVE_U16 + +/* Define to 1 if the system has the type `u32'. */ +#undef HAVE_U32 + +/* Define to 1 if the system has the type `u64'. */ +#undef HAVE_U64 + +/* Define to 1 if the system has the type `ulong'. */ +#undef HAVE_ULONG + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `ushort'. */ +#undef HAVE_USHORT + +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define to 1 if you have the `va_copy' function. */ +#undef HAVE_VA_COPY + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if you have the `vsyslog' function. */ +#undef HAVE_VSYSLOG + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + +/* Define to 1 if you have the `__va_copy' function. */ +#undef HAVE___VA_COPY + +/* send errors to stderr */ +#undef INITIALERRORSTO + +/* little endian */ +#undef LITTLE_ENDIAN_HOST + +/* 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 + +/* path to prelink */ +#undef PRELINK_PATH + +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `off64_t', as computed by sizeof. */ +#undef SIZEOF_OFF64_T + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* The size of `unsigned int', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_INT + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* The size of `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* The size of `unsigned short', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_SHORT + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* syslog priority */ +#undef SYSLOG_PRIORITY + +/* Define if LOCALE support should be used */ +#undef USE_LOCALE + +/* Version number of package */ +#undef VERSION + +/* use ACL */ +#undef WITH_ACL + +/* use audit library */ +#undef WITH_AUDIT + +/* use curl */ +#undef WITH_CURL + +/* use e2fsattrs */ +#undef WITH_E2FSATTRS + +/* use gcrypt library */ +#undef WITH_GCRYPT + +/* use mhash library */ +#undef WITH_MHASH + +/* use POSIX ACLs */ +#undef WITH_POSIX_ACL + +/* use prelink */ +#undef WITH_PRELINK + +/* postgresql support */ +#undef WITH_PSQL + +/* use SELinux */ +#undef WITH_SELINUX + +/* use ACL on Solaris */ +#undef WITH_SUN_ACL + +/* use xattr */ +#undef WITH_XATTR + +/* use zlib */ +#undef WITH_ZLIB + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..8d39c4b --- /dev/null +++ b/config.sub @@ -0,0 +1,1815 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-03-30' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..1965d82 --- /dev/null +++ b/configure @@ -0,0 +1,9744 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for aide 0.16. +# +# +# 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 about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +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='aide' +PACKAGE_TARNAME='aide' +PACKAGE_VERSION='0.16' +PACKAGE_STRING='aide 0.16' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +AIDE_DEFS +AUDITLIB +PSQLLIB +CRYPTLIB +USE_CURL_FALSE +USE_CURL_TRUE +curlconfig +E2FSATTRSLIB +ATTRLIB +ELFLIB +SELINUXLIB +ACLLIB +AIDE_USE_LOCALE +PCRELIB +EGREP +GREP +CPP +PKG_CONFIG +LD +LEXLIB +LEX_OUTPUT_ROOT +LEX +YFLAGS +YACC +RANLIB +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 +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_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_extra_includes +with_extra_libs +with_extra_link_libs +enable_static +with_mmap +with_locale +with_syslog_ident +with_syslog_facility +with_syslog_logopt +with_syslog_priority +with_zlib +with_curl +with_sun_acl +with_posix_acl +with_selinux +with_prelink +with_xattr +with_e2fsattrs +enable_lfs +with_config_file +with_mhash +with_gcrypt +with_confighmactype +with_confighmackey +with_dbhmactype +with_dbhmackey +enable_forced_configmd +enable_forced_dbmd +with_initial_errors_to +with_psql +with_audit +' + 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 aide 0.16 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/aide] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of aide 0.16:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-static Disable static linking (lowers the security of aide) + --disable-lfs Disable large file support on 32-bit platforms + --enable-forced-configmd + Forces the config to have checksum. Also disables + --config-check + --enable-forced-dbmd Forces the file/pipe database's to have checksum. + This will be the default in the next release. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-extra-includes Specify additional paths with -I to find headerfiles + --with-extra-libs Specify additional paths with -L to find libraries + --with-extra-link-libs Specify additional libraries to link + --with-mmap use mmap [default=check] + --with-locale use locale stuff + --with-syslog-ident syslog ident + --with-syslog-facility Specify syslog facility, see man syslog for options + --with-syslog-logopt Specify syslog logopt, see man syslog for options + --with-syslog-priority Specify syslog priority, see man syslog for options + --with-zlib use zlib compression + --with-curl use curl for http,https and ftp backends + --with-sun-acl use ACL on solaris (no checking) + --with-posix-acl use POSIX ACLs (no checking) + --with-selinux use SELinux (no checking) + --with-prelink use prelink (no checking) + --with-xattr use xattr (no checking) + --with-e2fsattrs use e2fsattrs (no checking) + --with-config-file=config-file + use config-file as the default config file + --with-mhash use libmhash, needed for hmacs [default=check] + --with-gcrypt use gcrypt library + --with-confighmactype=TYPE + Hash type to use for checking config. Valid values + are md5, sha1, sha256 and sha512. + --with-confighmackey=KEY HMAC + hash key to use for checking config. Must be a + base64 encoded byte stream. Maximum string length is + 31 chars. + --with-dbhmactype=TYPE Hash type to use for checking db. Valid values are + md5 and sha1. + --with-dbhmackey=KEY HMAC + hash key to use for checking db. Must be a base64 + encoded byte stream. Maximum string lentgth is 31 + chars. + --with-initial-errors-to=URL + Where errors should go while checking config. + Default is stderr. + --with-psql use postgresql library for storing databases + --with-audit use audit library + +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 the package provider. +_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 +aide configure 0.16 +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_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_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_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_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_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_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +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;} + ;; +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 +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 aide $as_me 0.16, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +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. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.15' + +# 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='aide' + VERSION='0.16' + + +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 + + +cat >>confdefs.h <<_ACEOF +#define AIDEVERSION "0.16" +_ACEOF + + + +ac_config_headers="$ac_config_headers config.h" + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" 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_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +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" + +if test "x${YACC}" != "xbison -y"; then + echo "AIDE requires GNU bison" + exit 5 +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 "x${LEX}" != "xflex"; then + echo "AIDE requires GNU flex" + exit 5 +fi +for ac_prog in ld +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_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # 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_LD="$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 +LD=$ac_cv_prog_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LD" && break +done + + +# Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="""" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + + +# Check whether --with-extra-includes was given. +if test "${with_extra_includes+set}" = set; then : + withval=$with_extra_includes; CPPFLAGS="$CPPFLAGS $withval" + +fi + + +# Check whether --with-extra-libs was given. +if test "${with_extra_libs+set}" = set; then : + withval=$with_extra_libs; LDFLAGS="$LDFLAGS $withval" + +fi + + +# Check whether --with-extra-link-libs was given. +if test "${with_extra_link_libs+set}" = set; then : + withval=$with_extra_link_libs; LIBS="$LIBS $withval" + +fi + + +AIDE_DEFS="-D_GNU_SOURCE" + + +if test $ac_cv_c_compiler_gnu = yes; then + LD_STATIC_FLAG='-static' + + case "$host_os" in + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + LD_STATIC_FLAG="$LD_STATIC_FLAG ${wl}-lC" + ;; + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + ## pic_flag='-m68020 -resident32 -malways-restore-a4' + ;; + sysv4*MP*) + ## if test -d /usr/nec; then + ## pic_flag=-Kconform_pic + ## fi + ;; + *) + ## pic_flag='-fPIC' + ;; + esac +else + # PORTME Check for PIC flags for the system compiler. + case "$host_os" in + aix3* | aix4*) + # All AIX code is PIC. + LD_STATIC_FLAG='-bnso -bI:/lib/syscalls.exp' + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better LD_STATIC_FLAG that works with the bundled CC? + ## wl='-Wl,' + LD_STATIC_FLAG="${wl}-a ${wl}archive" + ## pic_flag='+Z' + ;; + + irix5* | irix6*) + ## wl='-Wl,' + LD_STATIC_FLAG='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + ## wl='-Wl,' + LD_STATIC_FLAG='-non_shared' + ;; + + sco3.2v5*) + ## pic_flag='-Kpic' + LD_STATIC_FLAG='-dn' + ## special_shlib_compile_flags='-belf' + ;; + + solaris*) + ## pic_flag='-KPIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Wl,' + ;; + + sunos4*) + ## pic_flag='-PIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ## pic_flag='-KPIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Wl,' + ;; + + uts4*) + ## pic_flag='-pic' + LD_STATIC_FLAG='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + ## pic_flag='-Kconform_pic' + LD_STATIC_FLAG='-Bstatic' + fi + ;; + *) + ## can_build_shared=no + ;; + esac +fi + +# Check whether static linking has explicitly been disabled +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; aide_static_choice=$enableval +else + aide_static_choice=yes +fi + + +cc_supports_flag() { + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports \"$@\"" >&5 +$as_echo_n "checking whether $CC supports \"$@\"... " >&6; } + Cfile=/tmp/foo${$} + touch ${Cfile}.c + $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1 + rc=$? + rm -f ${Cfile}.c ${Cfile}.o + case $rc in + 0) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; };; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; };; + esac + return $rc +} + +ld_supports_flag() { + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $LD supports \"$@\"" >&5 +$as_echo_n "checking whether $LD supports \"$@\"... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int one(void) { return 1; } + int two(void) { return 2; } + +int +main () +{ + two(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + _ac_ld_flag_supported=yes +else + _ac_ld_flag_supported=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + if test "$_ac_ld_flag_supported" = "yes"; then + rm -f conftest.c + touch conftest.c + if $CC -c conftest.c; then + ld_out=`$LD $@ -o conftest conftest.o 2>&1` + ld_ret=$? + if test $ld_ret -ne 0 ; then + _ac_ld_flag_supported=no + elif echo "$ld_out" | egrep 'option ignored|^usage:|unrecognized option|illegal option' >/dev/null ; then + _ac_ld_flag_supported=no + fi + fi + rm -f conftest.c conftest.o conftest + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_ac_ld_flag_supported" >&5 +$as_echo "$_ac_ld_flag_supported" >&6; } + if test "$_ac_ld_flag_supported" = "yes" ; then + return 0 + else + return 1 + fi +} + +if test "$aide_static_choice" != "yes"; then + LD_STATIC_FLAG="" + EXTRA_LDFLAGS="" + EXTRA_CFLAGS="" + if test x$CC = "xgcc"; then + if ld_supports_flag -z,relro; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-z,relro" + fi + if ld_supports_flag -z,now; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-z,now" + fi + if cc_supports_flag -fPIE -DPIE; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -fPIE -DPIE" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -pie" + fi + if cc_supports_flag -Wundef; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wundef" + fi + if cc_supports_flag -Wmissing-format-attribute; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wmissing-format-attribute" + fi + if cc_supports_flag -Wshadow; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow" + fi + if cc_supports_flag -Wlogical-op; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wlogical-op" + fi + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing syslog" >&5 +$as_echo_n "checking for library containing syslog... " >&6; } +if ${ac_cv_search_syslog+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char syslog (); +int +main () +{ +return syslog (); + ; + return 0; +} +_ACEOF +for ac_lib in '' bsd socket inet; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_syslog=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_syslog+:} false; then : + break +fi +done +if ${ac_cv_search_syslog+:} false; then : + +else + ac_cv_search_syslog=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_syslog" >&5 +$as_echo "$ac_cv_search_syslog" >&6; } +ac_res=$ac_cv_search_syslog +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +$as_echo "#define HAVE_SYSLOG 1" >>confdefs.h + +fi + +for ac_func in vsyslog +do : + ac_fn_c_check_func "$LINENO" "vsyslog" "ac_cv_func_vsyslog" +if test "x$ac_cv_func_vsyslog" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VSYSLOG 1 +_ACEOF + +fi +done + + +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 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +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_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +$as_echo "#define BIG_ENDIAN_HOST 1" >>confdefs.h +;; #( + no) + +$as_echo "#define LITTLE_ENDIAN_HOST 1" >>confdefs.h + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +ac_fn_c_check_type "$LINENO" "byte" "ac_cv_type_byte" "$ac_includes_default" +if test "x$ac_cv_type_byte" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_BYTE 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "ushort" "ac_cv_type_ushort" "$ac_includes_default" +if test "x$ac_cv_type_ushort" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_USHORT 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "ulong" "ac_cv_type_ulong" "$ac_includes_default" +if test "x$ac_cv_type_ulong" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_ULONG 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "u16" "ac_cv_type_u16" "$ac_includes_default" +if test "x$ac_cv_type_u16" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_U16 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "u32" "ac_cv_type_u32" "$ac_includes_default" +if test "x$ac_cv_type_u32" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_U32 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "u64" "ac_cv_type_u64" "$ac_includes_default" +if test "x$ac_cv_type_u64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_U64 1 +_ACEOF + + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5 +$as_echo_n "checking size of unsigned short... " >&6; } +if ${ac_cv_sizeof_unsigned_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5 +$as_echo "$ac_cv_sizeof_unsigned_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 +$as_echo_n "checking size of unsigned int... " >&6; } +if ${ac_cv_sizeof_unsigned_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 +$as_echo "$ac_cv_sizeof_unsigned_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 +$as_echo_n "checking size of unsigned long... " >&6; } +if ${ac_cv_sizeof_unsigned_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 +$as_echo_n "checking size of unsigned long long... " >&6; } +if ${ac_cv_sizeof_unsigned_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long +_ACEOF + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +$as_echo_n "checking for long double with more range or precision than double... " >&6; } +if ${ac_cv_type_long_double_wider+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } + +int +main () +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_long_double_wider=yes +else + ac_cv_type_long_double_wider=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +$as_echo "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + + fi + + ac_cv_c_long_double=$ac_cv_type_long_double_wider + if test $ac_cv_c_long_double = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + + +{ $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 + +for ac_func in strtoll strtoimax readdir +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 + + +# Check definition of readdir_r +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking args to readdir_r" >&5 +$as_echo_n "checking args to readdir_r... " >&6; } +if ${aide_cv_readdir_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef SCO +#define _REENTRANT +#endif +#define _POSIX_PTHREAD_SEMANTICS +#include +#include +int +main () +{ + int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); +readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + aide_cv_readdir_r=POSIX +else + aide_cv_readdir_r=other +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aide_cv_readdir_r" >&5 +$as_echo "$aide_cv_readdir_r" >&6; } +if test "$aide_cv_readdir_r" = "POSIX" +then + +$as_echo "#define HAVE_READDIR_R 1" >>confdefs.h + +fi + +for ac_func in stricmp strnstr strnlen +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 + + + +# Check whether --with-mmap was given. +if test "${with_mmap+set}" = set; then : + withval=$with_mmap; +else + with_mmap=check + +fi + + +if test "x$with_mmap" != xno; then : + for ac_func in mmap +do : + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MMAP 1 +_ACEOF + +fi +done + + compoptionstring="${compoptionstring}WITH_MMAP\\n" + +fi + +for ac_func in fcntl ftruncate posix_fadvise asprintf snprintf \ + vasprintf vsnprintf va_copy __va_copy +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 ISO C99 compliant snprintf" >&5 +$as_echo_n "checking for ISO C99 compliant snprintf... " >&6; } +if ${ac_cv_func_snprintf_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_snprintf_c99=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int main() +{ + char buf[] = {0, 0, 0, 0}; + + snprintf(buf, 3, "ABC"); + exit ((buf[2] != 0) || (snprintf(NULL, 0, "%d", 100) != 3)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_snprintf_c99=yes +else + ac_cv_func_snprintf_c99=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_snprintf_c99" >&5 +$as_echo "$ac_cv_func_snprintf_c99" >&6; } +if test $ac_cv_func_snprintf_c99 = yes; then + +$as_echo "#define HAVE_C99_SNPRINTF 1" >>confdefs.h + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 compliant vsnprintf" >&5 +$as_echo_n "checking for ISO C99 compliant vsnprintf... " >&6; } +if ${ac_cv_func_vsnprintf_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vsnprintf_c99=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int doit(char *buf, int len, const char *s, ...) +{ + va_list ap; + int r; + + va_start(ap, s); + r = vsnprintf(buf, len, s, ap); + va_end(ap); + + return r; +} + +int main() +{ + char buf[] = {0, 0, 0, 0}; + + doit(buf, 3, "ABC"); + exit ((buf[2] != 0) || (doit(NULL, 0, "%d", 100) != 3)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vsnprintf_c99=yes +else + ac_cv_func_vsnprintf_c99=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_vsnprintf_c99" >&5 +$as_echo "$ac_cv_func_vsnprintf_c99" >&6; } +if test $ac_cv_func_vsnprintf_c99 = yes; then + +$as_echo "#define HAVE_C99_VSNPRINTF 1" >>confdefs.h + +fi + +# Linux has the O_NOATIME flag, sometimes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for open/O_NOATIME" >&5 +$as_echo_n "checking for open/O_NOATIME... " >&6; } +if ${db_cv_open_o_noatime+:} false; then : + $as_echo_n "(cached) " >&6 +else + +echo "test for working open/O_NOATIME" > __o_noatime_file +if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifndef O_NOATIME +#if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +#define O_NOATIME 01000000 +#else +#define O_NOATIME 0 +#endif +#endif +int +main () +{ + + open("__o_noatime_file", O_RDONLY | O_NOATIME, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + db_cv_open_o_noatime=yes +else + db_cv_open_o_noatime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifndef O_NOATIME +#if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +#define O_NOATIME 01000000 +#else +#define O_NOATIME 0 +#endif +#endif +main() { +int c, fd = open("__o_noatime_file", O_RDONLY | O_NOATIME, 0); +exit ((!O_NOATIME) || (fd == -1) || (read(fd, &c, 1) != 1)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + db_cv_open_o_noatime=yes +else + db_cv_open_o_noatime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +rm -f __o_noatime_file +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_cv_open_o_noatime" >&5 +$as_echo "$db_cv_open_o_noatime" >&6; } +if test "$db_cv_open_o_noatime" = yes; then + $as_echo "#define HAVE_O_NOATIME 1" >>confdefs.h + + +fi + +for ac_header in syslog.h inttypes.h fcntl.h ctype.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 + + +PCRELIB="-lpcre" +if test "$aide_static_choice" == "yes"; then + PCRELIB="$PCRELIB -pthread" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_exec in -lpcre" >&5 +$as_echo_n "checking for pcre_exec in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_exec+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcre $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 pcre_exec (); +int +main () +{ +return pcre_exec (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pcre_pcre_exec=yes +else + ac_cv_lib_pcre_pcre_exec=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_pcre_pcre_exec" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_exec" >&6; } +if test "x$ac_cv_lib_pcre_pcre_exec" = xyes; then : + + compoptionstring="${compoptionstring}WITH_PCRE\\n" + +else + as_fn_error $? "You don't have pcre library properly installed." "$LINENO" 5 + +fi + + + + +# Check whether --with-locale was given. +if test "${with_locale+set}" = set; then : + withval=$with_locale; +else + with_locale=no + +fi + + +if test "x$with_locale" != xno; then : + for ac_header in libintl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL_H 1 +_ACEOF + +$as_echo "#define USE_LOCALE 1" >>confdefs.h + + AIDE_USE_LOCALE="" + compoptionstring="${compoptionstring}WITH_LOCALE\\n" +fi + +done + + +fi + + + + +# Check whether --with-syslog_ident was given. +if test "${with_syslog_ident+set}" = set; then : + withval=$with_syslog_ident; +cat >>confdefs.h <<_ACEOF +#define AIDE_IDENT "$withval" +_ACEOF + + compoptionstring="${compoptionstring}AIDE_IDENT=${withval}\\n" +else + +cat >>confdefs.h <<_ACEOF +#define AIDE_IDENT "aide" +_ACEOF + + +fi + + + +# Check whether --with-syslog_facility was given. +if test "${with_syslog_facility+set}" = set; then : + withval=$with_syslog_facility; +cat >>confdefs.h <<_ACEOF +#define AIDE_SYSLOG_FACILITY $withval +_ACEOF + + compoptionstring="${compoptionstring}AIDE_SYSLOG_FACILITY=${withval}\\n" +else + +cat >>confdefs.h <<_ACEOF +#define AIDE_SYSLOG_FACILITY LOG_LOCAL0 +_ACEOF + + +fi + + + +# Check whether --with-syslog_logopt was given. +if test "${with_syslog_logopt+set}" = set; then : + withval=$with_syslog_logopt; +cat >>confdefs.h <<_ACEOF +#define AIDE_LOGOPT $withval +_ACEOF + +else + +cat >>confdefs.h <<_ACEOF +#define AIDE_LOGOPT LOG_CONS +_ACEOF + + +fi + + + +# Check whether --with-syslog_priority was given. +if test "${with_syslog_priority+set}" = set; then : + withval=$with_syslog_priority; +cat >>confdefs.h <<_ACEOF +#define SYSLOG_PRIORITY $withval +_ACEOF + + compoptionstring="${compoptionstring}SYSLOG_PRIORITY=${withval}\\n" +else + +cat >>confdefs.h <<_ACEOF +#define SYSLOG_PRIORITY LOG_NOTICE +_ACEOF + + +fi + + + + +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; +else + with_zlib=yes + +fi + + + +# Check whether --with-curl was given. +if test "${with_curl+set}" = set; then : + withval=$with_curl; +else + with_curl=no + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sun-acl-support" >&5 +$as_echo_n "checking for sun-acl-support... " >&6; } + +# Check whether --with-sun-acl was given. +if test "${with_sun_acl+set}" = set; then : + withval=$with_sun_acl; +else + with_sun_acl=no + +fi + + +if test "x$with_sun_acl" != xno; then : + +$as_echo "#define WITH_SUN_ACL 1" >>confdefs.h + + +$as_echo "#define WITH_ACL 1" >>confdefs.h + + ACLLIB="-lsec" + compoptionstring="${compoptionstring}WITH_SUN_ACL\\n" + aideextragroups="${aideextragroups}+acl" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix-acl-support" >&5 +$as_echo_n "checking for posix-acl-support... " >&6; } + +# Check whether --with-posix-acl was given. +if test "${with_posix_acl+set}" = set; then : + withval=$with_posix_acl; +else + with_posix_acl_support=no + +fi + + +if test "x$with_posix_acl_support" != xno; then : + +$as_echo "#define WITH_POSIX_ACL 1" >>confdefs.h + + +$as_echo "#define WITH_ACL 1" >>confdefs.h + + ACLLIB="-lacl" + compoptionstring="${compoptionstring}WITH_POSIX_ACL\\n" + aideextragroups="${aideextragroups}+acl" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for selinux-support" >&5 +$as_echo_n "checking for selinux-support... " >&6; } + +# Check whether --with-selinux was given. +if test "${with_selinux+set}" = set; then : + withval=$with_selinux; with_selinux_support="$withval" +else + with_selinux_support=no + +fi + + +if test "x$with_selinux_support" != xno; then : + +$as_echo "#define WITH_SELINUX 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libselinux; then + if test "$aide_static_choice" == "yes"; then + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux --static) + else + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux) + fi + else + SELINUXLIB="-lselinux" + if test "$aide_static_choice" == "yes"; then + saveLIBS=$LIBS + LIBS="-static $SELINUXLIB" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lgetfilecon_raw" >&5 +$as_echo_n "checking for library containing lgetfilecon_raw... " >&6; } +if ${ac_cv_search_lgetfilecon_raw+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lgetfilecon_raw (); +int +main () +{ +return lgetfilecon_raw (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_lgetfilecon_raw=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_lgetfilecon_raw+:} false; then : + break +fi +done +if ${ac_cv_search_lgetfilecon_raw+:} false; then : + +else + ac_cv_search_lgetfilecon_raw=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lgetfilecon_raw" >&5 +$as_echo "$ac_cv_search_lgetfilecon_raw" >&6; } +ac_res=$ac_cv_search_lgetfilecon_raw +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + SELINUXLIB="$SELINUXLIB -lpthread" +fi + + LIBS=$saveLIBS + fi + fi + compoptionstring="${compoptionstring}WITH_SELINUX\\n" + aideextragroups="${aideextragroups}+selinux" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prelink-support" >&5 +$as_echo_n "checking for prelink-support... " >&6; } + +# Check whether --with-prelink was given. +if test "${with_prelink+set}" = set; then : + withval=$with_prelink; case $with_prelink in + yes) +cat >>confdefs.h <<_ACEOF +#define PRELINK_PATH "/usr/sbin/prelink" +_ACEOF + + +$as_echo "#define WITH_PRELINK 1" >>confdefs.h + + ELFLIB="-lelf" + compoptionstring="${compoptionstring}WITH_PRELINK\\n" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: /usr/sbin/prelink" >&5 +$as_echo "/usr/sbin/prelink" >&6; } + ;; + no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + *) +cat >>confdefs.h <<_ACEOF +#define PRELINK_PATH "$with_prelink" +_ACEOF + + +$as_echo "#define WITH_PRELINK 1" >>confdefs.h + + ELFLIB="-lelf" + compoptionstring="${compoptionstring}WITH_PRELINK\\n" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_prelink" >&5 +$as_echo "$with_prelink" >&6; } + ;; + esac +else + with_prelink=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xattr-support" >&5 +$as_echo_n "checking for xattr-support... " >&6; } + +# Check whether --with-xattr was given. +if test "${with_xattr+set}" = set; then : + withval=$with_xattr; with_xattr_support="$withval" +else + with_xattr_support=no + +fi + + +if test "x$with_xattr_support" != xno; then : + +$as_echo "#define WITH_XATTR 1" >>confdefs.h + + ATTRLIB=-lattr + compoptionstring="${compoptionstring}WITH_XATTR\\n" + aideextragroups="${aideextragroups}+xattrs" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for e2fsattrs-support" >&5 +$as_echo_n "checking for e2fsattrs-support... " >&6; } + +# Check whether --with-e2fsattrs was given. +if test "${with_e2fsattrs+set}" = set; then : + withval=$with_e2fsattrs; with_e2fsattrs_support="$withval" +else + with_e2fsattrs_support=no + +fi + + +if test "x$with_e2fsattrs_support" != xno; then : + +$as_echo "#define WITH_E2FSATTRS 1" >>confdefs.h + + E2FSATTRSLIB=-le2p + compoptionstring="${compoptionstring}WITH_E2FSATTRS\\n" + aideextragroups="${aideextragroups}+e2fsattrs" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +# Check whether LFS has explicitly been disabled +# Check whether --enable-lfs was given. +if test "${enable_lfs+set}" = set; then : + enableval=$enable_lfs; aide_lfs_choice=$enableval +else + aide_lfs_choice=yes +fi + + +if test "$aide_lfs_choice" = "yes"; then +# This looks weird because Linux defines lstat64 and then screws it up +ac_fn_c_check_func "$LINENO" "lstat64" "ac_cv_func_lstat64" +if test "x$ac_cv_func_lstat64" = xyes; then : + ac_fn_c_check_func "$LINENO" "stat64" "ac_cv_func_stat64" +if test "x$ac_cv_func_stat64" = xyes; then : + AIDE_DEFS="$AIDE_DEFS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + AIDE_LSTAT_FUNC="lstat64" + compoptionstring="${compoptionstring}WITH_LSTAT64\\n" + AIDE_STAT_FUNC="stat64" + AIDE_FSTAT_FUNC="fstat64" + AIDE_STAT_TYPE="stat64" + AIDE_OFF_TYPE="off64_t" + +$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h + + AIDE_BLKCNT_TYPE="blkcnt64_t" + ac_fn_c_check_func "$LINENO" "readdir64" "ac_cv_func_readdir64" +if test "x$ac_cv_func_readdir64" = xyes; then : + AIDE_READDIR_FUNC="readdir64" + compoptionstring="${compoptionstring}WITH_READDIR64\\n" +else + AIDE_READDIR_FUNC="readdir" +fi + + ac_fn_c_check_func "$LINENO" "readdir64_r" "ac_cv_func_readdir64_r" +if test "x$ac_cv_func_readdir64_r" = xyes; then : + AIDE_READDIR_R_FUNC="readdir64_r" +else + AIDE_READDIR_R_FUNC="readdir_r" +fi + +else + AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n" + +fi + +else + AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n" + +fi + + +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $AIDE_DEFS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS ino_t" >&5 +$as_echo_n "checking for LFS ino_t... " >&6; } +if ${ac_cv_ino_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then : + ac_cv_ino_type=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_ino_type=ino64_t +else + ac_cv_ino_type=ino_t +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_ino_type" >&5 +$as_echo "$ac_cv_ino_type" >&6; } +AIDE_INO_TYPE=$ac_cv_ino_type + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LFS dirent" >&5 +$as_echo_n "checking for LFS dirent... " >&6; } +if ${ac_cv_dirent_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +int +main () +{ +struct dirent64 de; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_dirent_type=dirent64 +else + ac_cv_dirent_type=dirent +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dirent_type" >&5 +$as_echo "$ac_cv_dirent_type" >&6; } +AIDE_DIRENT_TYPE=$ac_cv_dirent_type +else + AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n" + AIDE_INO_TYPE=ino_t + AIDE_DIRENT_TYPE=dirent +fi +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5 +$as_echo_n "checking size of off64_t... " >&6; } +if ${ac_cv_sizeof_off64_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off64_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off64_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off64_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5 +$as_echo "$ac_cv_sizeof_off64_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t +_ACEOF + + +CFLAGS="$saved_CFLAGS" + + +cat >>confdefs.h <<_ACEOF +#define AIDE_LSTAT_FUNC $AIDE_LSTAT_FUNC +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_STAT_FUNC $AIDE_STAT_FUNC +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_FSTAT_FUNC $AIDE_FSTAT_FUNC +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_STAT_TYPE $AIDE_STAT_TYPE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_INO_TYPE $AIDE_INO_TYPE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_OFF_TYPE $AIDE_OFF_TYPE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_BLKCNT_TYPE $AIDE_BLKCNT_TYPE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_READDIR_FUNC $AIDE_READDIR_FUNC +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_READDIR_R_FUNC $AIDE_READDIR_R_FUNC +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define AIDE_DIRENT_TYPE $AIDE_DIRENT_TYPE +_ACEOF + + + +# Check whether --with-config_file was given. +if test "${with_config_file+set}" = set; then : + withval=$with_config_file; config_file=$withval +else + if test "x$sysconfdir" != x'${prefix}/etc'; then + config_file=`eval echo "$sysconfdir/aide.conf"` + elif test "x$prefix" != xNONE; then + config_file="$prefix/etc/aide.conf" + else + config_file="$ac_default_prefix/etc/aide.conf" + fi + +fi + + + +cat >>confdefs.h <<_ACEOF +#define CONFIG_FILE "$config_file" +_ACEOF + + +if test "x$sysconfdir" != x'${prefix}/etc'; then + evalled_sysconfdir=`eval echo "$sysconfdir"` + default_db="$evalled_sysconfdir/aide.db" + default_db_out="$evalled_sysconfdir/aide.db.new" +elif test "x$prefix" != xNONE; then + default_db="$prefix/etc/aide.db" + default_db_out="$prefix/etc/aide.db.new" +else + default_db="$ac_default_prefix/etc/aide.db" + default_db_out="$ac_default_prefix/etc/aide.db.new" +fi + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_DB "$default_db" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_DB_OUT "$default_db_out" +_ACEOF + + +LDFLAGS="$LDFLAGS $LD_STATIC_FLAG" +if test x$with_zlib = xyes; then + for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + +else + as_fn_error $? "You don't have zlib properly installed. Install it or try --without-zlib." "$LINENO" 5 +fi + +done + + save_LDFLAGS=$LDFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } +if ${ac_cv_lib_z_deflate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $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 deflate (); +int +main () +{ +return deflate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_deflate=yes +else + ac_cv_lib_z_deflate=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_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error $? "You don't have zlib properly installed. Install it or try --without-zlib." "$LINENO" 5 + +fi + + +$as_echo "#define WITH_ZLIB 1" >>confdefs.h + + compoptionstring="${compoptionstring}WITH_ZLIB\\n" +fi + +if test x$with_curl = xyes; then + # Extract the first word of ""curl-config"", so it can be a program name with args. +set dummy "curl-config"; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_curlconfig+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $curlconfig in + [\\/]* | ?:[\\/]*) + ac_cv_path_curlconfig="$curlconfig" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_curlconfig="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +curlconfig=$ac_cv_path_curlconfig +if test -n "$curlconfig"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curlconfig" >&5 +$as_echo "$curlconfig" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "_$curlconfig" != _ ; then + CURL_CFLAGS=`$curlconfig --cflags` + CURL_LIBS=`$curlconfig --libs` + else + as_fn_error $? "You don't have curl properly installed. Install it or try --without-curl." "$LINENO" 5 + fi + for ac_header in curl/curl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" +if test "x$ac_cv_header_curl_curl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CURL_CURL_H 1 +_ACEOF + +else + as_fn_error $? "You don't have curl properly installed. Install it or try --without-curl." "$LINENO" 5 +fi + +done + + CFLAGS="$CFLAGS $CURL_CFLAGS" + LDFLAGS="$LDFLAGS $CURL_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5 +$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } +if ${ac_cv_lib_curl_curl_easy_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurl $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 curl_easy_init (); +int +main () +{ +return curl_easy_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curl_curl_easy_init=yes +else + ac_cv_lib_curl_curl_easy_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5 +$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } +if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then : + havecurl=yes +else + as_fn_error $? "You don't have curl properly installed. Install it or try --without-curl." "$LINENO" 5 + +fi + + +$as_echo "#define WITH_CURL 1" >>confdefs.h + + compoptionstring="${compoptionstring}WITH_CURL\\n" +fi + if test x$havecurl = xyes; then + USE_CURL_TRUE= + USE_CURL_FALSE='#' +else + USE_CURL_TRUE='#' + USE_CURL_FALSE= +fi + + + +# Check whether --with-mhash was given. +if test "${with_mhash+set}" = set; then : + withval=$with_mhash; +else + with_mhash=check + +fi + + +if test "x$with_mhash" != xno; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mhash_get_block_size in -lmhash" >&5 +$as_echo_n "checking for mhash_get_block_size in -lmhash... " >&6; } +if ${ac_cv_lib_mhash_mhash_get_block_size+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmhash $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 mhash_get_block_size (); +int +main () +{ +return mhash_get_block_size (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mhash_mhash_get_block_size=yes +else + ac_cv_lib_mhash_mhash_get_block_size=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_mhash_mhash_get_block_size" >&5 +$as_echo "$ac_cv_lib_mhash_mhash_get_block_size" >&6; } +if test "x$ac_cv_lib_mhash_mhash_get_block_size" = xyes; then : + CRYPTLIB="${CRYPTLIB} -lmhash" + compoptionstring="${compoptionstring}WITH_MHASH\\n" + with_mhash=yes + aideextragroups="${aideextragroups}+whirlpool" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int i=MHASH_WHIRLPOOL; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_MHASH_WHIRLPOOL 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +$as_echo "#define WITH_MHASH 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No mhash means no hmac." >&5 +$as_echo "$as_me: WARNING: No mhash means no hmac." >&2;} + +fi + + +fi + + +# Check whether --with-gcrypt was given. +if test "${with_gcrypt+set}" = set; then : + withval=$with_gcrypt; +else + if test "x$with_mhash" != xyes; then + with_gcrypt=check + else + with_gcrypt=no + fi + +fi + + +if test "x$with_gcrypt" != xno; then : + +$as_echo "#define WITH_GCRYPT 1" >>confdefs.h + + if test "x$with_mhash" = xyes; then + as_fn_error $? "Using gcrypt together with mhash makes no sense. To disable mhash use --without-mhash" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpg_strerror in -lgpg-error" >&5 +$as_echo_n "checking for gpg_strerror in -lgpg-error... " >&6; } +if ${ac_cv_lib_gpg_error_gpg_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpg-error $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 gpg_strerror (); +int +main () +{ +return gpg_strerror (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gpg_error_gpg_strerror=yes +else + ac_cv_lib_gpg_error_gpg_strerror=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_gpg_error_gpg_strerror" >&5 +$as_echo "$ac_cv_lib_gpg_error_gpg_strerror" >&6; } +if test "x$ac_cv_lib_gpg_error_gpg_strerror" = xyes; then : + saveLIBS="$LIBS" + LIBS="$LIBS -lgpg-error" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5 +$as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; } +if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgcrypt $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 gcry_md_hash_buffer (); +int +main () +{ +return gcry_md_hash_buffer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gcrypt_gcry_md_hash_buffer=yes +else + ac_cv_lib_gcrypt_gcry_md_hash_buffer=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_gcrypt_gcry_md_hash_buffer" >&5 +$as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; } +if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGCRYPT 1 +_ACEOF + + LIBS="-lgcrypt $LIBS" + +else + as_fn_error $? "Aide requires mhash or libcrypt to be installed with static libraries." "$LINENO" 5 + +fi + + LIBS="$saveLIBS" +else + as_fn_error $? "You need to have libgpg-error.a installed to use libgcrypt." "$LINENO" 5 + +fi + + CRYPTLIB="${CRYPTLIB} -lgcrypt -lgpg-error" + with_gcrypt=yes + compoptionstring="${compoptionstring}WITH_GCRYPT\\n" +else + with_gcrypt=no + +fi + + + + +# Check whether --with-confighmactype was given. +if test "${with_confighmactype+set}" = set; then : + withval=$with_confighmactype; if test "x$withval" = "xmd5" ;then + CONFIGHMACTYPE="MHASH_MD5" + else if test "x$withval" = "xsha1" ;then + CONFIGHMACTYPE="MHASH_SHA1" + else if test "x$withval" = "xsha256" ;then + CONFIGHMACTYPE="MHASH_SHA256" + else if test "x$withval" = "xsha512" ;then + CONFIGHMACTYPE="MHASH_SHA512" + else + echo "Valid parameters for --with-confighmactype are md5, sha1, sha256 and sha512" + exit 1 + fi + fi + fi + fi + +cat >>confdefs.h <<_ACEOF +#define CONFIGHMACTYPE $CONFIGHMACTYPE +_ACEOF + +else + + +cat >>confdefs.h <<_ACEOF +#define CONFIGHMACTYPE MHASH_MD5 +_ACEOF + + +fi + + + +# Check whether --with-confighmackey was given. +if test "${with_confighmackey+set}" = set; then : + withval=$with_confighmackey; if test "x$withval" = "x" ; then + echo "--with-confighmackey requires a value" + exit 5 + fi + key00=`echo $withval|cut -c1-3` + key01=`echo $withval|cut -c4-6` + key02=`echo $withval|cut -c7-9` + key03=`echo $withval|cut -c10-12` + key04=`echo $withval|cut -c13-15` + key05=`echo $withval|cut -c16-18` + key06=`echo $withval|cut -c19-21` + key07=`echo $withval|cut -c22-24` + key08=`echo $withval|cut -c25-28` + key09=`echo $withval|cut -c29-31` + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_00 "$key00" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_01 "$key01" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_02 "$key02" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_03 "$key03" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_04 "$key04" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_05 "$key05" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_06 "$key06" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_07 "$key07" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_08 "$key08" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_09 "$key09" +_ACEOF + +else + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_00 "$key00" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_01 "$key01" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_02 "$key02" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_03 "$key03" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_04 "$key04" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_05 "$key05" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_06 "$key06" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_07 "$key07" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_08 "$key08" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CONFHMACKEY_09 "$key09" +_ACEOF + + +fi + + + + +# Check whether --with-dbhmactype was given. +if test "${with_dbhmactype+set}" = set; then : + withval=$with_dbhmactype; if test "x$withval" = "xmd5" ;then + DBHMACTYPE="MHASH_MD5" + else if test "x$withval" = "xsha1" ;then + DBHMACTYPE="MHASH_SHA1" + else if test "x$withval" = "xsha256" ;then + CONFIGHMACTYPE="MHASH_SHA256" + else if test "x$withval" = "xsha512" ;then + CONFIGHMACTYPE="MHASH_SHA512" + else + echo "Valid parameters for --with-dbhmactype are md5, sha1, sha256 and sha512" + exit 1 + fi + fi + fi + fi + +cat >>confdefs.h <<_ACEOF +#define DBHMACTYPE $DBHMACTYPE +_ACEOF + +else + + +cat >>confdefs.h <<_ACEOF +#define DBHMACTYPE MHASH_MD5 +_ACEOF + + +fi + + + +# Check whether --with-dbhmackey was given. +if test "${with_dbhmackey+set}" = set; then : + withval=$with_dbhmackey; if test "x$withval" = "x" ; then + echo "--with-dbhmackey requires a value" + exit 5 + fi + key00=`echo $withval|cut -c1-3` + key01=`echo $withval|cut -c4-6` + key02=`echo $withval|cut -c7-9` + key03=`echo $withval|cut -c10-12` + key04=`echo $withval|cut -c13-15` + key05=`echo $withval|cut -c16-18` + key06=`echo $withval|cut -c19-21` + key07=`echo $withval|cut -c22-24` + key08=`echo $withval|cut -c25-28` + key09=`echo $withval|cut -c29-31` + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_00 "$key00" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_01 "$key01" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_02 "$key02" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_03 "$key03" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_04 "$key04" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_05 "$key05" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_06 "$key06" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_07 "$key07" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_08 "$key08" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_09 "$key09" +_ACEOF + +else + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_00 "$key00" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_01 "$key01" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_02 "$key02" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_03 "$key03" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_04 "$key04" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_05 "$key05" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_06 "$key06" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_07 "$key07" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_08 "$key08" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBHMACKEY_09 "$key09" +_ACEOF + + +fi + + +# Check whether --enable-forced_configmd was given. +if test "${enable_forced_configmd+set}" = set; then : + enableval=$enable_forced_configmd; +$as_echo "#define FORCECONFIGMD 1" >>confdefs.h + +else + +$as_echo "#define FORCECONFIGMD 0" >>confdefs.h + + +fi + + +# Check whether --enable-forced_dbmd was given. +if test "${enable_forced_dbmd+set}" = set; then : + enableval=$enable_forced_dbmd; +$as_echo "#define FORCEDBMD 1" >>confdefs.h + +else + +$as_echo "#define FORCEDBMD 0" >>confdefs.h + + +fi + + + +# Check whether --with-initial_errors_to was given. +if test "${with_initial_errors_to+set}" = set; then : + withval=$with_initial_errors_to; +cat >>confdefs.h <<_ACEOF +#define INITIALERRORSTO "$withval" +_ACEOF + + compoptionstring="${compoptionstring}INITIALERRORSTO=${withval}\\n" +else + +cat >>confdefs.h <<_ACEOF +#define INITIALERRORSTO "stderr" +_ACEOF + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PostgresSQL support" >&5 +$as_echo_n "checking for PostgresSQL support... " >&6; } + +# Check whether --with-psql was given. +if test "${with_psql+set}" = set; then : + withval=$with_psql; +else + with_psql=no + +fi + + +if test "x$with_psql" != xno; then : + +$as_echo "#define WITH_PSQL 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQclear in -lpq" >&5 +$as_echo_n "checking for PQclear in -lpq... " >&6; } +if ${ac_cv_lib_pq_PQclear+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpq $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 PQclear (); +int +main () +{ +return PQclear (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pq_PQclear=yes +else + ac_cv_lib_pq_PQclear=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_pq_PQclear" >&5 +$as_echo "$ac_cv_lib_pq_PQclear" >&6; } +if test "x$ac_cv_lib_pq_PQclear" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPQ 1 +_ACEOF + + LIBS="-lpq $LIBS" + +else + with_psql=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + +fi + + PSQLLIB="-lpq" + compoptionstring="${compoptionstring}WITH_PSQL\\n" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + PSQLLIB="" + with_psql=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + + +# Check for Linux auditing API +# + +# Check whether --with-audit was given. +if test "${with_audit+set}" = set; then : + withval=$with_audit; +else + with_audit=no + +fi + + +if test "x$with_audit" != xno; then : + +$as_echo "#define WITH_AUDIT 1" >>confdefs.h + + ac_fn_c_check_header_mongrel "$LINENO" "libaudit.h" "ac_cv_header_libaudit_h" "$ac_includes_default" +if test "x$ac_cv_header_libaudit_h" = xyes; then : + +else + as_fn_error $? "You don't have libaudit properly installed. Install it if you need it." "$LINENO" 5 + +fi + + + AUDITLIB="-laudit" + if test "$aide_static_choice" == "yes"; then + saveLIBS=$LIBS + LIBS="-static $AUDITLIB" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for audit_log_user_message in -laudit" >&5 +$as_echo_n "checking for audit_log_user_message in -laudit... " >&6; } +if ${ac_cv_lib_audit_audit_log_user_message+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laudit $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 audit_log_user_message (); +int +main () +{ +return audit_log_user_message (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_audit_audit_log_user_message=yes +else + ac_cv_lib_audit_audit_log_user_message=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_audit_audit_log_user_message" >&5 +$as_echo "$ac_cv_lib_audit_audit_log_user_message" >&6; } +if test "x$ac_cv_lib_audit_audit_log_user_message" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAUDIT 1 +_ACEOF + + LIBS="-laudit $LIBS" + +else + + LIBS="$LIBS -lcap-ng" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for audit_log_user_message in -lcap-ng" >&5 +$as_echo_n "checking for audit_log_user_message in -lcap-ng... " >&6; } +if ${ac_cv_lib_cap_ng_audit_log_user_message+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap-ng $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 audit_log_user_message (); +int +main () +{ +return audit_log_user_message (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cap_ng_audit_log_user_message=yes +else + ac_cv_lib_cap_ng_audit_log_user_message=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_cap_ng_audit_log_user_message" >&5 +$as_echo "$ac_cv_lib_cap_ng_audit_log_user_message" >&6; } +if test "x$ac_cv_lib_cap_ng_audit_log_user_message" = xyes; then : + AUDITLIB="$AUDITLIB -lcap-ng" +else + as_fn_error $? "You don't have libaudit properly installed. Install it or try --without-audit." "$LINENO" 5 + +fi + + +fi + + LIBS=$saveLIBS + fi + compoptionstring="${compoptionstring}WITH_AUDIT\\n" +else + with_audit=no + +fi + + +extrasub="s&@aideextragroups@&$aideextragroups&;t t +s&@AIDEVERSION@&$PACKAGE_VERSION&;t t" + + ac_sources="$wk_link_files_src" +ac_dests="$wk_link_files_dst " +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source" +done +ac_config_links="$ac_config_links $ac_config_links_1" + + + +compoptionstring="${compoptionstring}CONFIG_FILE = \\\"${config_file}\\\"\\n" + + +cat >>confdefs.h <<_ACEOF +#define AIDECOMPILEOPTIONS "${compoptionstring}" +_ACEOF + + +LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" +CFLAGS="$CFLAGS $EXTRA_CFLAGS" + + +ac_config_files="$ac_config_files Makefile doc/aide.conf doc/aide.1 doc/aide.conf.5 aide.spec" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${USE_CURL_TRUE}" && test -z "${USE_CURL_FALSE}"; then + as_fn_error $? "conditional \"USE_CURL\" 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 aide $as_me 0.16, 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_links="$ac_config_links" +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 links: +$config_links + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +aide config.status 0.16 +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 + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/aide.conf") CONFIG_FILES="$CONFIG_FILES doc/aide.conf" ;; + "doc/aide.1") CONFIG_FILES="$CONFIG_FILES doc/aide.1" ;; + "doc/aide.conf.5") CONFIG_FILES="$CONFIG_FILES doc/aide.conf.5" ;; + "aide.spec") CONFIG_FILES="$CONFIG_FILES aide.spec" ;; + + *) 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_LINKS+set}" = set || CONFIG_LINKS=$config_links + 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 :L $CONFIG_LINKS :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 + ;; + :L) + # + # CONFIG_LINK + # + + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; + :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 + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..3598ebe --- /dev/null +++ b/configure.ac @@ -0,0 +1,1002 @@ +m4_include([version.m4]) + +dnl Initialize autoconf/automake +AC_INIT(aide, AIDE_VERSION) +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE([1.10 -Wall -Werror silent-rules subdir-objects]) + +AC_DEFINE_UNQUOTED(AIDEVERSION, "AIDE_VERSION") +AH_TEMPLATE([AIDEVERSION], [package version]) + +dnl The name of the configure h-file. +AM_CONFIG_HEADER(config.h) + +dnl Checks for programs. +AC_PROG_CC_C99 +AC_PROG_MAKE_SET +AC_PROG_RANLIB +AC_PROG_INSTALL +AC_PROG_YACC +if test "x${YACC}" != "xbison -y"; then + echo "AIDE requires GNU bison" + exit 5 +fi + +AC_PROG_LEX +if test "x${LEX}" != "xflex"; then + echo "AIDE requires GNU flex" + exit 5 +fi +AC_CHECK_PROGS(LD, ld) + +AC_PATH_PROG(PKG_CONFIG, pkg-config, "") +AM_PROG_CC_C_O + +dnl AC_ARG_PROGRAM + +AC_ARG_WITH(extra-includes, + AC_HELP_STRING([--with-extra-includes], + [Specify additional paths with -I to find headerfiles]), + [CPPFLAGS="$CPPFLAGS $withval"] +) +AC_ARG_WITH(extra-libs, + AC_HELP_STRING([--with-extra-libs], + [Specify additional paths with -L to find libraries]), + [LDFLAGS="$LDFLAGS $withval"] +) +AC_ARG_WITH(extra-link-libs, + AC_HELP_STRING([--with-extra-link-libs], + [Specify additional libraries to link]), + [LIBS="$LIBS $withval"] +) + +dnl Do the right thing for glibc... +AIDE_DEFS="-D_GNU_SOURCE" + +dnl This is borrowed from libtool + +if test $ac_cv_prog_gcc = yes; then + LD_STATIC_FLAG='-static' + + case "$host_os" in + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + LD_STATIC_FLAG="$LD_STATIC_FLAG ${wl}-lC" + ;; + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + ## pic_flag='-m68020 -resident32 -malways-restore-a4' + ;; + sysv4*MP*) + ## if test -d /usr/nec; then + ## pic_flag=-Kconform_pic + ## fi + ;; + *) + ## pic_flag='-fPIC' + ;; + esac +else + # PORTME Check for PIC flags for the system compiler. + case "$host_os" in + aix3* | aix4*) + # All AIX code is PIC. + LD_STATIC_FLAG='-bnso -bI:/lib/syscalls.exp' + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better LD_STATIC_FLAG that works with the bundled CC? + ## wl='-Wl,' + LD_STATIC_FLAG="${wl}-a ${wl}archive" + ## pic_flag='+Z' + ;; + + irix5* | irix6*) + ## wl='-Wl,' + LD_STATIC_FLAG='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + ## wl='-Wl,' + LD_STATIC_FLAG='-non_shared' + ;; + + sco3.2v5*) + ## pic_flag='-Kpic' + LD_STATIC_FLAG='-dn' + ## special_shlib_compile_flags='-belf' + ;; + + solaris*) + ## pic_flag='-KPIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Wl,' + ;; + + sunos4*) + ## pic_flag='-PIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ## pic_flag='-KPIC' + LD_STATIC_FLAG='-Bstatic' + ## wl='-Wl,' + ;; + + uts4*) + ## pic_flag='-pic' + LD_STATIC_FLAG='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + ## pic_flag='-Kconform_pic' + LD_STATIC_FLAG='-Bstatic' + fi + ;; + *) + ## can_build_shared=no + ;; + esac +fi + +# Check whether static linking has explicitly been disabled +AC_ARG_ENABLE(static,[ --disable-static Disable static linking (lowers the security of aide)], [aide_static_choice=$enableval], [aide_static_choice=yes]) + +dnl Borrowed from dbus +cc_supports_flag() { + AC_MSG_CHECKING(whether $CC supports "$@") + Cfile=/tmp/foo${$} + touch ${Cfile}.c + $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1 + rc=$? + rm -f ${Cfile}.c ${Cfile}.o + case $rc in + 0) AC_MSG_RESULT(yes);; + *) AC_MSG_RESULT(no);; + esac + return $rc +} + +dnl Borrowed from dbus +ld_supports_flag() { + AC_MSG_CHECKING([whether $LD supports "$@"]) + AC_TRY_LINK([ + int one(void) { return 1; } + int two(void) { return 2; } + ], [ two(); ] , [_ac_ld_flag_supported=yes], [_ac_ld_flag_supported=no]) + + if test "$_ac_ld_flag_supported" = "yes"; then + rm -f conftest.c + touch conftest.c + if $CC -c conftest.c; then + ld_out=`$LD $@ -o conftest conftest.o 2>&1` + ld_ret=$? + if test $ld_ret -ne 0 ; then + _ac_ld_flag_supported=no + elif echo "$ld_out" | egrep 'option ignored|^usage:|unrecognized option|illegal option' >/dev/null ; then + _ac_ld_flag_supported=no + fi + fi + rm -f conftest.c conftest.o conftest + fi + + AC_MSG_RESULT($_ac_ld_flag_supported) + if test "$_ac_ld_flag_supported" = "yes" ; then + return 0 + else + return 1 + fi +} + +if test "$aide_static_choice" != "yes"; then + LD_STATIC_FLAG="" + EXTRA_LDFLAGS="" + EXTRA_CFLAGS="" + if test x$CC = "xgcc"; then + if ld_supports_flag -z,relro; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-z,relro" + fi + if ld_supports_flag -z,now; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-z,now" + fi + if cc_supports_flag -fPIE -DPIE; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -fPIE -DPIE" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -pie" + fi + dnl Check for some optional warnings + if cc_supports_flag -Wundef; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wundef" + fi + if cc_supports_flag -Wmissing-format-attribute; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wmissing-format-attribute" + fi + if cc_supports_flag -Wshadow; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wshadow" + fi + if cc_supports_flag -Wlogical-op; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wlogical-op" + fi + fi +fi + +dnl This macro is new in autoconf-2.13 +AC_SEARCH_LIBS(syslog, bsd socket inet, [AC_DEFINE(HAVE_SYSLOG,1,[syslog available?])]) +AC_CHECK_FUNCS(vsyslog) + +AC_C_BIGENDIAN([AC_DEFINE(BIG_ENDIAN_HOST,1,[big endian])], [AC_DEFINE(LITTLE_ENDIAN_HOST,1,[little endian])]) + +AC_CHECK_TYPES([byte, ushort, ulong, u16, u32, u64]) + +AC_CHECK_SIZEOF(unsigned short, 2) +AC_CHECK_SIZEOF(unsigned int, 4) +AC_CHECK_SIZEOF(unsigned long, 4) +AC_CHECK_SIZEOF(long long, 8) +AC_CHECK_SIZEOF(unsigned long long, 8) +AC_C_LONG_DOUBLE + +AC_HEADER_STDC +AC_CHECK_FUNCS(strtoll strtoimax readdir) +AIDE_CHECK_READDIR_R_ARGS +AC_CHECK_FUNCS(stricmp strnstr strnlen) + +AC_ARG_WITH([mmap], + [AC_HELP_STRING([--with-mmap], + [use mmap @<:@default=check@:>@])], + [], + [with_mmap=check] +) + +AS_IF([test "x$with_mmap" != xno], + [AC_CHECK_FUNCS(mmap)] + compoptionstring="${compoptionstring}WITH_MMAP\\n" +) + +AC_CHECK_FUNCS(fcntl ftruncate posix_fadvise asprintf snprintf \ + vasprintf vsnprintf va_copy __va_copy) + +AC_CACHE_CHECK(for ISO C99 compliant snprintf,ac_cv_func_snprintf_c99, + [AC_TRY_RUN([ +#include + +int main() +{ + char buf[] = {0, 0, 0, 0}; + + snprintf(buf, 3, "ABC"); + exit ((buf[2] != 0) || (snprintf(NULL, 0, "%d", 100) != 3)); +}],ac_cv_func_snprintf_c99=yes,ac_cv_func_snprintf_c99=no,ac_cv_func_snprintf_c99=no)]) +if test $ac_cv_func_snprintf_c99 = yes; then + AC_DEFINE(HAVE_C99_SNPRINTF,1,[snprintf is ISO C99 compliant]) +fi +AC_CACHE_CHECK(for ISO C99 compliant vsnprintf,ac_cv_func_vsnprintf_c99, + [AC_TRY_RUN([ +#include +#include + +int doit(char *buf, int len, const char *s, ...) +{ + va_list ap; + int r; + + va_start(ap, s); + r = vsnprintf(buf, len, s, ap); + va_end(ap); + + return r; +} + +int main() +{ + char buf[] = {0, 0, 0, 0}; + + doit(buf, 3, "ABC"); + exit ((buf[2] != 0) || (doit(NULL, 0, "%d", 100) != 3)); +}],ac_cv_func_vsnprintf_c99=yes,ac_cv_func_vsnprintf_c99=no,ac_cv_func_vsnprintf_c99=no)]) +if test $ac_cv_func_vsnprintf_c99 = yes; then + AC_DEFINE(HAVE_C99_VSNPRINTF,1,[vsnprintf is ISO C99 compliant]) +fi + +# Linux has the O_NOATIME flag, sometimes +AC_CACHE_CHECK([for open/O_NOATIME], db_cv_open_o_noatime, [ +echo "test for working open/O_NOATIME" > __o_noatime_file +AC_TRY_RUN([ +#include +#include +#ifndef O_NOATIME +#if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +#define O_NOATIME 01000000 +#else +#define O_NOATIME 0 +#endif +#endif +main() { +int c, fd = open("__o_noatime_file", O_RDONLY | O_NOATIME, 0); +exit ((!O_NOATIME) || (fd == -1) || (read(fd, &c, 1) != 1)); +}], [db_cv_open_o_noatime=yes], [db_cv_open_o_noatime=no], +AC_TRY_LINK([ +#include +#include +#ifndef O_NOATIME +#if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +#define O_NOATIME 01000000 +#else +#define O_NOATIME 0 +#endif +#endif], [ + open("__o_noatime_file", O_RDONLY | O_NOATIME, 0); +], [db_cv_open_o_noatime=yes], [db_cv_open_o_noatime=no])) +rm -f __o_noatime_file]) +if test "$db_cv_open_o_noatime" = yes; then + AC_DEFINE(HAVE_O_NOATIME) + AH_TEMPLATE(HAVE_O_NOATIME, [Define to 1 if you have the O_NOATIME flag.]) +fi + +AC_CHECK_HEADERS(syslog.h inttypes.h fcntl.h ctype.h) + +PCRELIB="-lpcre" +if test "$aide_static_choice" == "yes"; then + PCRELIB="$PCRELIB -pthread" +fi +AC_CHECK_LIB(pcre, pcre_exec, [ + compoptionstring="${compoptionstring}WITH_PCRE\\n" + ], [AC_MSG_ERROR([You don't have pcre library properly installed.])] + ) +AC_SUBST(PCRELIB) + +AC_ARG_WITH([locale], + [AC_HELP_STRING([--with-locale], + [use locale stuff])], + [], + [with_locale=no] +) + +AS_IF([test "x$with_locale" != xno], + [AC_CHECK_HEADERS(libintl.h, + [AC_DEFINE(USE_LOCALE,1,[Define if LOCALE support should be used]) + AIDE_USE_LOCALE="" + compoptionstring="${compoptionstring}WITH_LOCALE\\n" +dnl AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/lib/locale",[Localedir to use])], + )] +) + +AC_SUBST(AIDE_USE_LOCALE) + +AC_ARG_WITH([syslog_ident], + AC_HELP_STRING([--with-syslog-ident], + [syslog ident]), + [AC_DEFINE_UNQUOTED(AIDE_IDENT,"$withval",[syslog ident])] + compoptionstring="${compoptionstring}AIDE_IDENT=${withval}\\n", + [AC_DEFINE_UNQUOTED(AIDE_IDENT,"aide",[syslog ident])] +) + +AC_ARG_WITH([syslog_facility], + AC_HELP_STRING([--with-syslog-facility], + [Specify syslog facility, see man syslog for options]), + [AC_DEFINE_UNQUOTED(AIDE_SYSLOG_FACILITY,$withval,[syslog facility])] + compoptionstring="${compoptionstring}AIDE_SYSLOG_FACILITY=${withval}\\n", + [AC_DEFINE_UNQUOTED(AIDE_SYSLOG_FACILITY,LOG_LOCAL0,[syslog facility])] +) + +AC_ARG_WITH([syslog_logopt], + AC_HELP_STRING([--with-syslog-logopt], + [Specify syslog logopt, see man syslog for options]), + [AC_DEFINE_UNQUOTED(AIDE_LOGOPT,$withval,[syslog logopt])], + [AC_DEFINE_UNQUOTED(AIDE_LOGOPT,LOG_CONS,[syslog logopt])] +) + +AC_ARG_WITH([syslog_priority], + AC_HELP_STRING([--with-syslog-priority], + [Specify syslog priority, see man syslog for options]), + [AC_DEFINE_UNQUOTED(SYSLOG_PRIORITY,$withval,[syslog priority])] + compoptionstring="${compoptionstring}SYSLOG_PRIORITY=${withval}\\n", + [AC_DEFINE_UNQUOTED(SYSLOG_PRIORITY,LOG_NOTICE,[syslog priority])] +) + + +AC_ARG_WITH([zlib], + AC_HELP_STRING([--with-zlib], + [use zlib compression]), + , + [with_zlib=yes] +) + +AC_ARG_WITH([curl], + AC_HELP_STRING([--with-curl], + [use curl for http,https and ftp backends]), + , + [with_curl=no] +) + +AC_MSG_CHECKING(for sun-acl-support) +AC_ARG_WITH([sun-acl], + [AC_HELP_STRING([--with-sun-acl], + [use ACL on solaris (no checking)])], + [], + [with_sun_acl=no] +) + +AS_IF([test "x$with_sun_acl" != xno], + [AC_DEFINE(WITH_SUN_ACL,1,[use ACL on Solaris]) + AC_DEFINE(WITH_ACL,1,[use ACL]) + ACLLIB="-lsec" + compoptionstring="${compoptionstring}WITH_SUN_ACL\\n" + aideextragroups="${aideextragroups}+acl" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING(for posix-acl-support) +AC_ARG_WITH([posix-acl], + [AC_HELP_STRING([--with-posix-acl], + [use POSIX ACLs (no checking)])], + [], + [with_posix_acl_support=no] +) + +AS_IF([test "x$with_posix_acl_support" != xno], + [AC_DEFINE(WITH_POSIX_ACL,1,[use POSIX ACLs]) + AC_DEFINE(WITH_ACL,1,[use ACL]) + ACLLIB="-lacl" + compoptionstring="${compoptionstring}WITH_POSIX_ACL\\n" + aideextragroups="${aideextragroups}+acl" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) + +AC_SUBST(ACLLIB) + +AC_MSG_CHECKING(for selinux-support) +AC_ARG_WITH([selinux], + [AC_HELP_STRING([--with-selinux], + [use SELinux (no checking)])], + [with_selinux_support="$withval"], + [with_selinux_support=no] +) + +AS_IF([test "x$with_selinux_support" != xno], + AC_DEFINE(WITH_SELINUX,1,[use SELinux]) + [AC_MSG_RESULT(yes) + if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libselinux; then + if test "$aide_static_choice" == "yes"; then + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux --static) + else + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux) + fi + else + SELINUXLIB="-lselinux" + if test "$aide_static_choice" == "yes"; then + saveLIBS=$LIBS + LIBS="-static $SELINUXLIB" + AC_SEARCH_LIBS([lgetfilecon_raw], [], [], [SELINUXLIB="$SELINUXLIB -lpthread"]) + LIBS=$saveLIBS + fi + fi + compoptionstring="${compoptionstring}WITH_SELINUX\\n" + aideextragroups="${aideextragroups}+selinux" + ], + [AC_MSG_RESULT(no)] +) + +AC_SUBST(SELINUXLIB) + + +AC_MSG_CHECKING(for prelink-support) +AC_ARG_WITH([prelink], + [AC_HELP_STRING([--with-prelink],[use prelink (no checking)])], + [case $with_prelink in + yes) AC_DEFINE_UNQUOTED(PRELINK_PATH, "/usr/sbin/prelink", [path to prelink]) + AC_DEFINE(WITH_PRELINK,1,[use prelink]) + ELFLIB="-lelf" + compoptionstring="${compoptionstring}WITH_PRELINK\\n" + AC_MSG_RESULT([/usr/sbin/prelink]) + ;; + no) AC_MSG_RESULT(no) + ;; + *) AC_DEFINE_UNQUOTED(PRELINK_PATH, "$with_prelink", [path to prelink]) + AC_DEFINE(WITH_PRELINK,1,[use prelink]) + ELFLIB="-lelf" + compoptionstring="${compoptionstring}WITH_PRELINK\\n" + AC_MSG_RESULT([$with_prelink]) + ;; + esac], + [with_prelink=no + AC_MSG_RESULT(no) + ] +) +AC_SUBST(ELFLIB) + +AC_MSG_CHECKING(for xattr-support) +AC_ARG_WITH([xattr], + [AC_HELP_STRING([--with-xattr], + [use xattr (no checking)])], + [with_xattr_support="$withval"], + [with_xattr_support=no] +) + +AS_IF([test "x$with_xattr_support" != xno], + [AC_DEFINE(WITH_XATTR,1,[use xattr]) + ATTRLIB=-lattr + compoptionstring="${compoptionstring}WITH_XATTR\\n" + aideextragroups="${aideextragroups}+xattrs" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) + +AC_SUBST(ATTRLIB) + +AC_MSG_CHECKING(for e2fsattrs-support) +AC_ARG_WITH([e2fsattrs], + [AC_HELP_STRING([--with-e2fsattrs], + [use e2fsattrs (no checking)])], + [with_e2fsattrs_support="$withval"], + [with_e2fsattrs_support=no] +) + +AS_IF([test "x$with_e2fsattrs_support" != xno], + [AC_DEFINE(WITH_E2FSATTRS,1,[use e2fsattrs]) + E2FSATTRSLIB=-le2p + compoptionstring="${compoptionstring}WITH_E2FSATTRS\\n" + aideextragroups="${aideextragroups}+e2fsattrs" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) + +AC_SUBST(E2FSATTRSLIB) + +# Check whether LFS has explicitly been disabled +AC_ARG_ENABLE(lfs,[ --disable-lfs Disable large file support on 32-bit platforms], [aide_lfs_choice=$enableval], [aide_lfs_choice=yes]) + +if test "$aide_lfs_choice" = "yes"; then +# This looks weird because Linux defines lstat64 and then screws it up +AC_CHECK_FUNC(lstat64, + [AC_CHECK_FUNC(stat64, + AIDE_DEFS="$AIDE_DEFS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + AIDE_LSTAT_FUNC="lstat64" + compoptionstring="${compoptionstring}WITH_LSTAT64\\n" + AIDE_STAT_FUNC="stat64" + AIDE_FSTAT_FUNC="fstat64" + AIDE_STAT_TYPE="stat64" + AIDE_OFF_TYPE="off64_t" + AC_DEFINE(HAVE_OFF64_T,1,[have off64_t]) + AIDE_BLKCNT_TYPE="blkcnt64_t" + [AC_CHECK_FUNC(readdir64, + AIDE_READDIR_FUNC="readdir64" + compoptionstring="${compoptionstring}WITH_READDIR64\\n", + AIDE_READDIR_FUNC="readdir")] + [AC_CHECK_FUNC(readdir64_r, + AIDE_READDIR_R_FUNC="readdir64_r", + AIDE_READDIR_R_FUNC="readdir_r")], + AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n" +)], + [AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n"] +) + +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $AIDE_DEFS" +AC_CACHE_CHECK([for LFS ino_t],ac_cv_ino_type,[ +AC_TRY_RUN([ +#include +#include +#include +#include +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], +ac_cv_ino_type=ino64_t,ac_cv_ino_type=ino_t,ac_cv_ino_type=cross)]) +AIDE_INO_TYPE=$ac_cv_ino_type + +AC_CACHE_CHECK([for LFS dirent],ac_cv_dirent_type,[ +AC_TRY_COMPILE([ +#include +#include +#include ], +[struct dirent64 de;], +ac_cv_dirent_type=dirent64,ac_cv_dirent_type=dirent)]) +AIDE_DIRENT_TYPE=$ac_cv_dirent_type +else + AIDE_LSTAT_FUNC="lstat" + AIDE_STAT_FUNC="stat" + AIDE_FSTAT_FUNC="fstat" + AIDE_STAT_TYPE="stat" + AIDE_OFF_TYPE="off_t" + AIDE_BLKCNT_TYPE="blkcnt_t" + AIDE_READDIR_FUNC="readdir" + AIDE_READDIR_R_FUNC="readdir_r" + compoptionstring="${compoptionstring}WITH_LSTAT\\n" + compoptionstring="${compoptionstring}WITH_READDIR\\n" + AIDE_INO_TYPE=ino_t + AIDE_DIRENT_TYPE=dirent +fi +AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(off64_t) +CFLAGS="$saved_CFLAGS" + +AC_DEFINE_UNQUOTED(AIDE_LSTAT_FUNC,$AIDE_LSTAT_FUNC,[lstat]) +AC_DEFINE_UNQUOTED(AIDE_STAT_FUNC,$AIDE_STAT_FUNC,[stat]) +AC_DEFINE_UNQUOTED(AIDE_FSTAT_FUNC,$AIDE_FSTAT_FUNC,[fstat]) +AC_DEFINE_UNQUOTED(AIDE_STAT_TYPE,$AIDE_STAT_TYPE,[stat type]) +AC_DEFINE_UNQUOTED(AIDE_INO_TYPE,$AIDE_INO_TYPE,[ino_t]) +AC_DEFINE_UNQUOTED(AIDE_OFF_TYPE,$AIDE_OFF_TYPE,[off_t]) +AC_DEFINE_UNQUOTED(AIDE_BLKCNT_TYPE,$AIDE_BLKCNT_TYPE,[blkcnt_t]) +AC_DEFINE_UNQUOTED(AIDE_READDIR_FUNC,$AIDE_READDIR_FUNC,[readdir]) +AC_DEFINE_UNQUOTED(AIDE_READDIR_R_FUNC,$AIDE_READDIR_R_FUNC,[readdir_r]) +AC_DEFINE_UNQUOTED(AIDE_DIRENT_TYPE,$AIDE_DIRENT_TYPE,[dirent]) + +AC_ARG_WITH([config_file], + AC_HELP_STRING([--with-config-file=config-file], + [use config-file as the default config file]), + [config_file=$withval], + [if test "x$sysconfdir" != x'${prefix}/etc'; then + config_file=`eval echo "$sysconfdir/aide.conf"` + elif test "x$prefix" != xNONE; then + config_file="$prefix/etc/aide.conf" + else + config_file="$ac_default_prefix/etc/aide.conf" + fi] +) + +AC_DEFINE_UNQUOTED(CONFIG_FILE,"$config_file",[Location of configuration file]) + +if test "x$sysconfdir" != x'${prefix}/etc'; then + evalled_sysconfdir=`eval echo "$sysconfdir"` + default_db="$evalled_sysconfdir/aide.db" + default_db_out="$evalled_sysconfdir/aide.db.new" +elif test "x$prefix" != xNONE; then + default_db="$prefix/etc/aide.db" + default_db_out="$prefix/etc/aide.db.new" +else + default_db="$ac_default_prefix/etc/aide.db" + default_db_out="$ac_default_prefix/etc/aide.db.new" +fi + +AC_DEFINE_UNQUOTED(DEFAULT_DB,"$default_db",[Default location of signature database]) +AC_DEFINE_UNQUOTED(DEFAULT_DB_OUT,"$default_db_out",[Default output location for newly-generated signature database]) + +dnl Do the library tests with the static flag +LDFLAGS="$LDFLAGS $LD_STATIC_FLAG" +if test x$with_zlib = xyes; then + AC_CHECK_HEADERS(zlib.h,[], + [AC_MSG_ERROR([You don't have zlib properly installed. Install it or try --without-zlib.])]) + save_LDFLAGS=$LDFLAGS + AC_CHECK_LIB(z, deflate,[], + [AC_MSG_ERROR([You don't have zlib properly installed. Install it or try --without-zlib.])] + ) + AC_DEFINE(WITH_ZLIB,1,[use zlib]) + compoptionstring="${compoptionstring}WITH_ZLIB\\n" +fi + +if test x$with_curl = xyes; then + AC_PATH_PROG(curlconfig, "curl-config") + if test "_$curlconfig" != _ ; then + CURL_CFLAGS=`$curlconfig --cflags` + CURL_LIBS=`$curlconfig --libs` + else + AC_MSG_ERROR([You don't have curl properly installed. Install it or try --without-curl.]) + fi + AC_CHECK_HEADERS(curl/curl.h,, + [AC_MSG_ERROR([You don't have curl properly installed. Install it or try --without-curl.])]) + CFLAGS="$CFLAGS $CURL_CFLAGS" + LDFLAGS="$LDFLAGS $CURL_LIBS" + AC_CHECK_LIB(curl,curl_easy_init,havecurl=yes, + [AC_MSG_ERROR([You don't have curl properly installed. Install it or try --without-curl.])] +) + AC_DEFINE(WITH_CURL,1,[use curl]) + compoptionstring="${compoptionstring}WITH_CURL\\n" +fi +AM_CONDITIONAL(USE_CURL, test x$havecurl = xyes) + +AC_ARG_WITH(mhash, + AC_HELP_STRING([--with-mhash], + [use libmhash, needed for hmacs @<:@default=check@:>@]), + [], + [with_mhash=check] +) + +AS_IF([test "x$with_mhash" != xno], + AC_CHECK_LIB([mhash],[mhash_get_block_size], + [CRYPTLIB="${CRYPTLIB} -lmhash" + compoptionstring="${compoptionstring}WITH_MHASH\\n" + with_mhash=yes + aideextragroups="${aideextragroups}+whirlpool" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include + int i=MHASH_WHIRLPOOL; + ]])],AC_DEFINE(HAVE_MHASH_WHIRLPOOL,1,[mhash has whirlpool])) + AC_DEFINE(WITH_MHASH,1,[use mhash library])], + [AC_MSG_WARN(No mhash means no hmac.)] + ) +) + +AC_ARG_WITH([gcrypt], + [AC_HELP_STRING([--with-gcrypt], + [use gcrypt library])], + [], + [if test "x$with_mhash" != xyes; then + with_gcrypt=check + else + with_gcrypt=no + fi] +) + +AS_IF([test "x$with_gcrypt" != xno], + [AC_DEFINE(WITH_GCRYPT,1,[use gcrypt library]) + if test "x$with_mhash" = xyes; then + AC_MSG_ERROR([Using gcrypt together with mhash makes no sense. To disable mhash use --without-mhash]) + fi + AC_CHECK_LIB([gpg-error], [gpg_strerror], + [saveLIBS="$LIBS" + LIBS="$LIBS -lgpg-error" + AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer],[], + AC_MSG_ERROR([Aide requires mhash or libcrypt to be installed with static libraries.]) + ) + LIBS="$saveLIBS"], + [AC_MSG_ERROR([You need to have libgpg-error.a installed to use libgcrypt.])] + ) + CRYPTLIB="${CRYPTLIB} -lgcrypt -lgpg-error" + with_gcrypt=yes + compoptionstring="${compoptionstring}WITH_GCRYPT\\n"], + [with_gcrypt=no] +) + +AC_SUBST(CRYPTLIB) + +AC_ARG_WITH([confighmactype], + AC_HELP_STRING([--with-confighmactype=TYPE], + [Hash type to use for checking config. Valid values are md5, sha1, sha256 and sha512.]), + [if test "x$withval" = "xmd5" ;then + CONFIGHMACTYPE="MHASH_MD5" + else if test "x$withval" = "xsha1" ;then + CONFIGHMACTYPE="MHASH_SHA1" + else if test "x$withval" = "xsha256" ;then + CONFIGHMACTYPE="MHASH_SHA256" + else if test "x$withval" = "xsha512" ;then + CONFIGHMACTYPE="MHASH_SHA512" + else + echo "Valid parameters for --with-confighmactype are md5, sha1, sha256 and sha512" + exit 1 + fi + fi + fi + fi + AC_DEFINE_UNQUOTED(CONFIGHMACTYPE,$CONFIGHMACTYPE,[hash type for config file check])], + [ + AC_DEFINE_UNQUOTED(CONFIGHMACTYPE,MHASH_MD5,[hash type for config file check])] +, +) + +AC_ARG_WITH([confighmackey], + AC_HELP_STRING([--with-confighmackey=KEY HMAC], + [hash key to use for checking config. Must be a base64 encoded byte stream. Maximum string length is 31 chars.]), + [if test "x$withval" = "x" ; then + echo "--with-confighmackey requires a value" + exit 5 + fi + key00=`echo $withval|cut -c1-3` + key01=`echo $withval|cut -c4-6` + key02=`echo $withval|cut -c7-9` + key03=`echo $withval|cut -c10-12` + key04=`echo $withval|cut -c13-15` + key05=`echo $withval|cut -c16-18` + key06=`echo $withval|cut -c19-21` + key07=`echo $withval|cut -c22-24` + key08=`echo $withval|cut -c25-28` + key09=`echo $withval|cut -c29-31` + + AC_DEFINE_UNQUOTED(CONFHMACKEY_00,"$key00",[HMAC key 00]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_01,"$key01",[HMAC key 01]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_02,"$key02",[HMAC key 02]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_03,"$key03",[HMAC key 03]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_04,"$key04",[HMAC key 04]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_05,"$key05",[HMAC key 05]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_06,"$key06",[HMAC key 06]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_07,"$key07",[HMAC key 07]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_08,"$key08",[HMAC key 08]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_09,"$key09",[HMAC key 09])], + [ + AC_DEFINE_UNQUOTED(CONFHMACKEY_00,"$key00",[HMAC key 00]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_01,"$key01",[HMAC key 01]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_02,"$key02",[HMAC key 02]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_03,"$key03",[HMAC key 03]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_04,"$key04",[HMAC key 04]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_05,"$key05",[HMAC key 05]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_06,"$key06",[HMAC key 06]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_07,"$key07",[HMAC key 07]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_08,"$key08",[HMAC key 08]) + AC_DEFINE_UNQUOTED(CONFHMACKEY_09,"$key09",[HMAC key 09])] +) + + +AC_ARG_WITH([dbhmactype], + AC_HELP_STRING([--with-dbhmactype=TYPE], + [Hash type to use for checking db. Valid values are md5 and sha1.]), + [if test "x$withval" = "xmd5" ;then + DBHMACTYPE="MHASH_MD5" + else if test "x$withval" = "xsha1" ;then + DBHMACTYPE="MHASH_SHA1" + else if test "x$withval" = "xsha256" ;then + CONFIGHMACTYPE="MHASH_SHA256" + else if test "x$withval" = "xsha512" ;then + CONFIGHMACTYPE="MHASH_SHA512" + else + echo "Valid parameters for --with-dbhmactype are md5, sha1, sha256 and sha512" + exit 1 + fi + fi + fi + fi + AC_DEFINE_UNQUOTED(DBHMACTYPE,$DBHMACTYPE,[hash type for checking db])], + [ + AC_DEFINE_UNQUOTED(DBHMACTYPE,MHASH_MD5,[hash type for checking db])] +) + +AC_ARG_WITH([dbhmackey], + AC_HELP_STRING([--with-dbhmackey=KEY HMAC], + [hash key to use for checking db. Must be a base64 encoded byte stream. Maximum string lentgth is 31 chars.]), + [if test "x$withval" = "x" ; then + echo "--with-dbhmackey requires a value" + exit 5 + fi + key00=`echo $withval|cut -c1-3` + key01=`echo $withval|cut -c4-6` + key02=`echo $withval|cut -c7-9` + key03=`echo $withval|cut -c10-12` + key04=`echo $withval|cut -c13-15` + key05=`echo $withval|cut -c16-18` + key06=`echo $withval|cut -c19-21` + key07=`echo $withval|cut -c22-24` + key08=`echo $withval|cut -c25-28` + key09=`echo $withval|cut -c29-31` + + AC_DEFINE_UNQUOTED(DBHMACKEY_00,"$key00",[DB HMAC key 00]) + AC_DEFINE_UNQUOTED(DBHMACKEY_01,"$key01",[DB HMAC key 01]) + AC_DEFINE_UNQUOTED(DBHMACKEY_02,"$key02",[DB HMAC key 02]) + AC_DEFINE_UNQUOTED(DBHMACKEY_03,"$key03",[DB HMAC key 03]) + AC_DEFINE_UNQUOTED(DBHMACKEY_04,"$key04",[DB HMAC key 04]) + AC_DEFINE_UNQUOTED(DBHMACKEY_05,"$key05",[DB HMAC key 05]) + AC_DEFINE_UNQUOTED(DBHMACKEY_06,"$key06",[DB HMAC key 06]) + AC_DEFINE_UNQUOTED(DBHMACKEY_07,"$key07",[DB HMAC key 07]) + AC_DEFINE_UNQUOTED(DBHMACKEY_08,"$key08",[DB HMAC key 08]) + AC_DEFINE_UNQUOTED(DBHMACKEY_09,"$key09",[DB HMAC key 09])], + [ + AC_DEFINE_UNQUOTED(DBHMACKEY_00,"$key00",[DB HMAC key 00]) + AC_DEFINE_UNQUOTED(DBHMACKEY_01,"$key01",[DB HMAC key 01]) + AC_DEFINE_UNQUOTED(DBHMACKEY_02,"$key02",[DB HMAC key 02]) + AC_DEFINE_UNQUOTED(DBHMACKEY_03,"$key03",[DB HMAC key 03]) + AC_DEFINE_UNQUOTED(DBHMACKEY_04,"$key04",[DB HMAC key 04]) + AC_DEFINE_UNQUOTED(DBHMACKEY_05,"$key05",[DB HMAC key 05]) + AC_DEFINE_UNQUOTED(DBHMACKEY_06,"$key06",[DB HMAC key 06]) + AC_DEFINE_UNQUOTED(DBHMACKEY_07,"$key07",[DB HMAC key 07]) + AC_DEFINE_UNQUOTED(DBHMACKEY_08,"$key08",[DB HMAC key 08]) + AC_DEFINE_UNQUOTED(DBHMACKEY_09,"$key09",[DB HMAC key 09])] +) + +AC_ARG_ENABLE(forced_configmd, + AC_HELP_STRING([--enable-forced-configmd], + [Forces the config to have checksum. Also disables --config-check]), + [AC_DEFINE(FORCECONFIGMD,1,[force config checksum])], + [AC_DEFINE(FORCECONFIGMD,0,[don't force config checksum])] +) + +AC_ARG_ENABLE(forced_dbmd, + AC_HELP_STRING([--enable-forced-dbmd], + [Forces the file/pipe database's to have checksum. This will be the default in the next release.]), + AC_DEFINE(FORCEDBMD,1,[force database checksum]), + AC_DEFINE(FORCEDBMD,0,[don't force database checksum]) +) + +AC_ARG_WITH(initial_errors_to, + AC_HELP_STRING([--with-initial-errors-to=URL], + [Where errors should go while checking config. Default is stderr.]), + AC_DEFINE_UNQUOTED(INITIALERRORSTO,"$withval",[send errors here]) + compoptionstring="${compoptionstring}INITIALERRORSTO=${withval}\\n", + AC_DEFINE_UNQUOTED(INITIALERRORSTO,"stderr",[send errors to stderr]) +) + +AC_MSG_CHECKING(for PostgresSQL support) +AC_ARG_WITH([psql], + [AC_HELP_STRING([--with-psql], + [use postgresql library for storing databases])], + [], + [with_psql=no] +) + +AS_IF([test "x$with_psql" != xno], + AC_DEFINE(WITH_PSQL,1,[postgresql support]) + AC_CHECK_LIB(pq,PQclear,[], + with_psql=no + AC_MSG_RESULT([not found]) + ) + PSQLLIB="-lpq" + compoptionstring="${compoptionstring}WITH_PSQL\\n" + AC_MSG_RESULT(yes), + PSQLLIB="" + [with_psql=no] + AC_MSG_RESULT([no]) +) + +AC_SUBST(PSQLLIB) + +# Check for Linux auditing API +# +AC_ARG_WITH([audit], + [AC_HELP_STRING([--with-audit], + [use audit library])], + [], + [with_audit=no] +) + +AS_IF([test "x$with_audit" != xno], + [AC_DEFINE(WITH_AUDIT,1,[use audit library]) + AC_CHECK_HEADER(libaudit.h,, + AC_MSG_ERROR(You don't have libaudit properly installed. Install it if you need it.) + ) + AUDITLIB="-laudit" + if test "$aide_static_choice" == "yes"; then + saveLIBS=$LIBS + LIBS="-static $AUDITLIB" + AC_CHECK_LIB([audit], [audit_log_user_message], [], [ + LIBS="$LIBS -lcap-ng" + AC_CHECK_LIB([cap-ng], [audit_log_user_message], [AUDITLIB="$AUDITLIB -lcap-ng"], + AC_MSG_ERROR([You don't have libaudit properly installed. Install it or try --without-audit.]) + , []) + ], []) + LIBS=$saveLIBS + fi + compoptionstring="${compoptionstring}WITH_AUDIT\\n"], + [with_audit=no] +) +AC_SUBST(AUDITLIB) + +extrasub="s&@aideextragroups@&$aideextragroups&;t t +s&@AIDEVERSION@&$PACKAGE_VERSION&;t t" + +AIDE_DO_LINK_FILES + +compoptionstring="${compoptionstring}CONFIG_FILE = \\\"${config_file}\\\"\\n" + +AC_DEFINE_UNQUOTED(AIDECOMPILEOPTIONS, "${compoptionstring}",[Compile-time options displayed in -v output]) + +dnl Add in the optional compiler features +LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" +CFLAGS="$CFLAGS $EXTRA_CFLAGS" + +AC_SUBST(AIDE_DEFS) +AC_OUTPUT(Makefile doc/aide.conf doc/aide.1 doc/aide.conf.5 aide.spec) + diff --git a/contrib/aide-attributes.sh b/contrib/aide-attributes.sh new file mode 100644 index 0000000..bafc81e --- /dev/null +++ b/contrib/aide-attributes.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# Copyright © 2010 Hannes von Haugwitz + +# 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 + +set -e +set -u + +attributes=( "filename" "linkname" "perm" "uid" "gid" "size" "atime" \ + "ctime" "mtime" "inode" "bcount" "lnkcount" "md5" "sha1" \ + "rmd160" "tiger" "crc32" "haval" "gost" "crc32b" "attr" \ + "acl" "bsize" "rdev" "dev" "checkmask" "growingsize" "checkinode" \ + "allownewfile" "allowrmfile" "sha256" "sha512" "selinux" \ + "xattrs" "whirlpool" "ftype" "e2fsattrs" ) + +NAME="aide-attributes" + +err() { + echo "$NAME: $1!" >&2 + echo "usage: $NAME HEX_NUMBER [HEX_NUMBER]" + exit $2 +} + +dec2hex() { + let hex=0x$1 2> /dev/null || err "argument '$1' is no valid hex number" 2 + if [ "$hex" -lt "0" ] || [ "$hex" -gt "$((2**${#attributes[@]}))" ] ; then + err "argument '$1' too large (> 2^${#attributes[@]})" 3 + fi + echo "$hex" +} + +COMPARE=false + +if [ -n "${1:-}" ] ; then + a=$(dec2hex $1) + if [ -n "${2:-}" ] ; then + COMPARE=true + b=$(dec2hex $2) + [ -n "${3:-}" ] && err "Too much arguments provided" 4 + fi +else + err "Not enough arguments provided" 1; +fi + +for (( i=0; i<${#attributes[@]}; i++ )) ; do + if $COMPARE ; then + if (( 2**$i & $a )) && ! (( 2**$i & $b )) ; then + echo "-"${attributes[$i]} + elif ! (( 2**$i & $a )) && (( 2**$i & $b )) ; then + echo "+"${attributes[$i]} + fi + else + if (( 2**$i & $a )) ; then + echo "${attributes[$i]}" + fi + fi +done + +exit 0 diff --git a/contrib/bzip2.sh b/contrib/bzip2.sh new file mode 100644 index 0000000..f86fe63 --- /dev/null +++ b/contrib/bzip2.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Lifted from E-mails by Sven.Hartrumpf@fernuni-hagen.de +# +# The idea is to set database_out=stderr in aide.conf you can then use +# this one liner to decompress aide.db and recompress aide.db.new + +bzcat aide.db.bz2 | ( /media/floppy/aide -c aide.conf --verbose=0 -u 1> /tmp/aideu.log ) 2>&1 | bzip2 -9 > aide.db.new diff --git a/contrib/gpg2_check.sh b/contrib/gpg2_check.sh new file mode 100644 index 0000000..cd3db33 --- /dev/null +++ b/contrib/gpg2_check.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# $Id$ + +# Script by Vincent Danen + +hostname=`uname -n` +echo "AIDE integrity check for ${hostname} beginning (`date`)" +echo "" +if [ ! -e /var/lib/aide/aide.db ] ; then + echo "**** Error: AIDE database for ${hostname} not found." + echo "**** Run 'aide --init' and move the appropriate database file." +else + if [ -f /etc/aide.conf ]; then + if [ -f /var/lib/aide/aide.db.sig ]; then + pushd /var/lib/aide >/dev/null + echo "Verifying the GPG signature on the database..." + echo "" + gpg --verify aide.db.sig + echo "" + if [ "$?" == "1" ]; then + echo "************************************************************" + echo "GPG signature FAILED! Your database has been tampered with!" + echo "************************************************************" + exit 1 + fi + popd >/dev/null + fi + nice -20 /usr/sbin/aide --check 2>/dev/null + fi +fi + +exit 0 diff --git a/contrib/gpg2_update.sh b/contrib/gpg2_update.sh new file mode 100644 index 0000000..583940e --- /dev/null +++ b/contrib/gpg2_update.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# $Id$ +# +# script to update and rotate the AIDE database files and, optionally +# create a detached GPG signature to verify the database file +# +# written by Vincent Danen 01/21/2006 + +usegpg=0 + +if [ -f /root/.gnupg/secring.gpg ]; then + usegpg=1 +fi + +if [ ! -d /var/lib/aide ]; then + echo "The AIDE database directory /var/lib/aide does not exist!" + exit 1 +fi + +pushd /var/lib/aide >/dev/null + +# copy the old database +if [ -f aide.db ]; then + newfile="aide-`hostname`-`date +%Y%m%d-%H%M%S`.db" + if [ "${usegpg}" == 1 -a -f aide.db.sig ]; then + # do an integrity check + gpg --verify aide.db.sig + if [ "$?" == "1" ]; then + echo "************************************************************" + echo "GPG signature FAILED! Your database has been tampered with!" + echo "************************************************************" + exit 1 + fi + fi + cp -av aide.db ${newfile} + /usr/sbin/aide --update -B "database=file:/var/lib/aide/${newfile}" + if [ "${usegpg}" == "1" ]; then + # create the signature file + [[ -f aide.db.sig ]] && rm -f aide.db.sig + gpg --detach-sign aide.db + if [ "$?" == "1" ]; then + echo "FATAL: Error occurred when creating the signature file!" + exit 1 + fi + fi + gzip -9f ${newfile} +else + echo "The AIDE database does not exist, can't update!" + exit 1 +fi + +popd >/dev/null diff --git a/contrib/gpg_check.sh b/contrib/gpg_check.sh new file mode 100644 index 0000000..6ad7758 --- /dev/null +++ b/contrib/gpg_check.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# $Id$ + +# aide check script +# Written by: charlie heselton +# Email: echo "hfouvyAdpy/ofu" | perl -pe 's/(.)/chr(ord($1)-1)/ge' +# 09/23/2005 + +# Set up some variables +DBDIR="/your/aide/db/directory" +DBFILE="${DBDIR}/aide.db" +ENC_DBFILE="${DBDIR}/aide.db.gpg" + +# make the assumption that the database exists and is encrypted +# but test for it ;-) +[[ -f ${ENC_DBFILE} ]] && /usr/bin/gpg --batch -d ${ENC_DBFILE} > ${DBFILE} +rm -f ${ENC_DBFILE} + +# (for now, we'll assume that encrypting the file includes an integrity check ) +# Run the check. +/usr/bin/aide -C > /tmp/aide_check.out 2>&1 + +# mail out the results +/usr/bin/cat /tmp/aide_check.out | /usr/bin/mutt -s "AIDE Check for `date`" your_valid_email@somewhere.com + +# cleanup +# if the mail was successful, delete the output file +if [ $? -eq 0 ] +then + rm -f /tmp/aide_check.out +fi + +# re-encrypt the database and delete the unencrypted version +/usr/bin/gpg --batch -se -r gentoo_root ${DBFILE} +rm -f ${DBFILE} diff --git a/contrib/gpg_update.sh b/contrib/gpg_update.sh new file mode 100644 index 0000000..4246106 --- /dev/null +++ b/contrib/gpg_update.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# $Id$ + +# aide update script +# Written by: charlie heselton +# Email: echo "hfouvyAdpy/ofu" | perl -pe 's/(.)/chr(ord($1)-1)/ge' +# 09/23/2005 + +DBDIR="/etc/aide/db" +DBFILE="${DBDIR}/aide.db" +ENC_DBFILE="${DBDIR}/aide.db.gpg" + +# make the assumption that the database exists and is encrypted +# but test for it ;-) +[[ -f ${ENC_DBFILE} ]] && /usr/bin/gpg --batch -d ${ENC_DBFILE} > ${DBFILE} +rm -f ${ENC_DBFILE} + +# (for now, we'll assume that encrypting the file includes an integrity check ) +# Run the update. +/usr/bin/aide --update > /tmp/aide_update.out 2>&1 + +# mail out the results +# set the "Reply-to" address +REPLYTO="root@charlesheselton.no-ip.org" +export REPLYTO +# send the mail +/usr/bin/cat /tmp/aide_update.out | /usr/bin/mutt -s "AIDE Update for `date`" your_valid_email@somewhere.com + +# cleanup +# if the mailing was successful then delete the output file +if [ $? -eq 0 ] +then + rm -f /tmp/aide_update.out +fi + +# move the aide.db.new file to the aide.db +mv ${DBDIR}/aide.db.new ${DBFILE} + +# encrypt the new db file and remove the unencrypted version +/usr/bin/gpg --batch -se -r gentoo_root ${DBFILE} +rm -f ${DBFILE} diff --git a/contrib/sshaide.sh b/contrib/sshaide.sh new file mode 100644 index 0000000..ffa60f3 --- /dev/null +++ b/contrib/sshaide.sh @@ -0,0 +1,445 @@ +#!/bin/sh +# +# $Id$ +# +# NAME +# sshaide.sh - SSH/AIDE remote integrity monitoring script +# +# SYNOPSIS +# sshaide.sh -check|-init ALL| +# +# DESCRIPTION +# sshaide.sh uses AIDE and SSH to remotely run integrity checks +# on ALL configured client systems or those specifically listed on +# the command line from a centralized manager station. sshaide.sh +# stores all binaries, databases and reports on a secure, centralized +# manager station. Database initialization or periodic checks are +# run on demand or via cron jobs from the manager stations based on +# local policy requirements. +# +# sshaide.sh requires a valid account on the remote system and uses +# SSH RSA authentication with public/private password-less key pairs +# to obtain automated, scripted access to a remote system. Naturally +# the account(s), sshaide.sh keys and manager system must be heavily +# protected from compromise. To minimize potential problems, it is +# recommended that sshaide.sh use non-privileged accounts. While +# this limits access to verify some files and diretories on remote +# systems, we believe it is an acceptable trade-off. Most critical +# files and directories can be effectively monitored without having +# privileged access. It is recommended that an unprivileged, but +# dedicated account on the manager station also be setup to manage +# AIDE databases, AIDE reports, remote logins and other sshaide.sh +# requirements. +# +# Remote clients must have the public SSH RSA key that will be used +# by the sshaide.sh manager. The sshaide.sh manager must have the +# managed client's SSH server RSA public key in known_hosts or +# hostkeys file. Refer to your SSH documentation for instructions +# on setting up public SSH RSA keys. +# +# OPTIONS +# The option must be given in the proper order and with proper +# syntax. +# +# -init Initialize or re-initialize the AIDE database for the +# listed host or hosts. +# +# -check Run an integrity check on the specified system or systems. +# The database for any host being checked must have already +# been intialized. +# +# DIRECTORIES and FILES +# ~/ +# This is the home directory of the user running sshaide.sh. +# By default, this is retrieved from the $HOME environment +# variable. +# +# ~/bin +# The directory where the sshaide.sh script and AIDE +# binaries are stored. Required. +# +# ~/bin/sshaide.sh +# The sshaide.sh program. This file. Required. +# +# ~/bin/aide.[platform] +# The AIDE binary for a [platform]. For example, a Linux +# 2.4 binary may be named aide.linux-2.4. These binaries +# will be linked to from the independent client directories +# based on their platform requirements. Required. +# +# ~/configs +# The directory where the AIDE configuration files are +# stored. Common AIDE configurations are stored here and +# can be linked to from the independent client directories +# based on policy requirements. Required. +# +# ~/reports +# This directory will store the initialization logs and +# integrity check reports. Integrity reports will be +# tar.gz'd by year-month-day-hour. Required, but created +# automatically by sshaide.sh. +# +# ~/clients +# This is the parent directory for all client hosts being +# managed. Required. +# +# ~/clients/[client-host] +# This directory is a specific client host to be managed by +# sshaide.sh. [client-host] is a host name. Short host name +# is usually sufficient, but a fully qualified domain name +# may be used if there may be host name overlap from different +# subdomains. Required for each client to be managed by +# sshaide.sh. +# +# ~/clients/[client-host]/aide.db_[client_host] +# This file is the AIDE database for the [client-host] being +# managed by sshaide.sh. Required, but created automatically +# by the -init process. +# +# ~/clients/[client-host]/aide.db_[client-host].old +# This file is the previous AIDE database before the last +# -init process. Not required. Created automatically after +# the second or additional database initialization. +# +# ~/clients/[client-host]/sshaide.conf +# This file contains client specific configuration information. +# Optional. The following three options are available: +# +# emaillist comma-separated-list-of-addresses +# This option specifies the email addresses that +# sshaide.sh output should be delivered to. +# homedir full-home-diretory-path-on-client +# This option specifies the fully qualified path +# used on the client host. This would be equivalanet +# to the $HOME environment variable on the client +# system. +# userid remote-user-id +# This option specifies the remote login id with +# which to login to the remote system with. +# +# All configuration options are optional, but if present, +# they must be begin in column 1 with whitespace separting +# the desired value(s). +# +# ~/clients/[client-host]/reinit +# The existence of this file indicates that the AIDE database +# for this client host should be reinitialized through the +# -init process on the next run. Simply `touch` this file +# whenever you want to reinitialize the client host database. +# This file will be automaticaly removed after the next -init +# process. Optional. +# +# ~/clients/[client-host]/aide.conf +# This is a soft link to the appropriate AIDE configuration +# file in ~/configs. The following two lines are required +# for each configuration file: +# +# database=file:./aide.db +# database_out=file:./aide.newdb +# +# ~/clients/[client-host]/aide +# This is a soft link to the appropriate AIDE binary for +# the client host platform in ~/bin. Required. +# +# ~/tmp +# This is a temporary work directory for sshaide.sh. +# Required. +# +# Original concept and coding from: +# Judith A Freeman +# University of Chicago +# Network Security Center +# +# 28 June 1998 to 16 May 2000 +# +# Updates by: +# John Kristoff +# +# Northwestern University +# Telecommunications and Network Services +# +# 2003-12-03,jtk: updated for AIDE v0.10 and Linux +# newly packaged as sshaide.sh +# adjusted default path to something more reasonable for linux +# replaced tripwire references with aide naming conventions +# replaced hard coded root user id with $userid variable from whoami +# added LC_ALL=C for grep to work with traditional [] interpretations +# added a cd to remote_aidedir on remote machine +# forced remote_aidedir directory creation (with 'mkdir -p') +# added quotes to ssh commands +# changed the email subject and header format +# changed mail delivery and email creation handling +# minor commenting edits +# adjusted wordlist for Linux and Solaris, exiting if file not found +# removed $1 for wordlist +# implemented config file for remote_aidedir and emaillist per machine +# changed reinit check from read (-r) to write (-w) check +# fixed tar/gzip'ing of reports only on -check mode +# removed unncessary root directory variable, use just aidedir +# 2003-12-06,jtk:minor configuration updates +# added userid option to config and created $useriddefault +# set default remote home directory with $homedefault +# 2003-12-16,jtk: fixed sshaide.conf usage +# added doc about userid config in sshaide.conf +# changed order of sshaide.conf config options so remote_aidedir works +# 2004-02-12,jtk: minor doc editing + +### +### Basic setup +### + +# Get a limited path +PATH=/bin:/usr/bin:/usr/local/bin:/usr/ucb + +# For debugging only +# set -x + +### +### Local variable declarations +### + +# set the remote username to login and run aide as +useriddefault=`whoami` + +# Who gets the mail if not set in client dir? +maildefault=root@localhost + +# remote home directory +homedefault=/home/${useriddefault} + +# $date in the form year-month-day-hour +date=`date +%Y-%m-%d-%H` + +# Where are we running out of +aidedir=${HOME} + +# Setup local directories and files for use +clientdir=${aidedir}/clients +tmpdir=${aidedir}/tmp + +progname=`basename $0` + +### +### Functions +### + +# Give usage statement +usage () { + echo "" + echo "Usage: `${progname}` ALL|" + echo " run-mode: -init | -check" + echo " machine-list: space separated list in quotes" + echo "" +} + +## gen_rand_word - returns a semi-random word +## only returns words that are all lowercase letters + +gen_rand_word () { + # Set the word list + if test -r "/usr/share/dict/words" ; then + # For Linux + _wordlist="/usr/share/dict/words" + elif test -r "/usr/dict/words" ; then + # For Solaris + _wordlist="/usr/dict/words" + else + echo ERROR: words file not found! Exiting... + exit 0 + fi + + _randnum=`date +%H%S%Y%m%H%d%S%S` + _listlines=`cat ${_wordlist} | wc -l` + _linenum=`expr ${_randnum} % ${_listlines}` + + # If we picked line 0, change it to 1 'cause line 0 doesn't exist + if test ${_linenum} -eq 0 ; then + _linenum=1 + fi + + _randword=`grep -n . ${_wordlist} | grep "^${_linenum}:" | cut -d: -f2` + + # If $_randword has anything other than lower-case chars, try again + (echo ${_randword} | LC_ALL=C grep '[^a-z]' 2>&1 >> /dev/null \ + && gen_rand_word ) || \ + + # Return the word + echo ${_randword} +} + +init_cmds () { + + if test ! -d ${aidedir}/reports/initlogs/ ; then + mkdir -p ${aidedir}/reports/initlogs/ + fi + + ssh -l $userid $machine "(umask 077 ; cd ${remote_aidedir}; ${remote_aidedir}/aide --init --config=${remote_aidedir}/aide.conf 2>&1 | tee ${remote_aidedir}/initoutput >> /dev/null)" + + # Copy output back to file + mkdir -p ${tmpdir}/initoutput/${date} + scp -q ${userid}@${machine}:${remote_aidedir}/initoutput ${inittmp}/${machine} + # backup old database if it exists + if test -r ${clientdir}/${machine}/aide.db_${machine} ; then + mv ${clientdir}/${machine}/aide.db_${machine} ${clientdir}/${machine}/aide.db_${machine}.old + fi + + scp -q ${userid}@${machine}:${remote_aidedir}/aide.newdb ${clientdir}/${machine}/aide.db_${machine} +} + +check_cmds () { + scp -q $db ${userid}@${machine}:${remote_aidedir}/aide.db + ssh -l $userid $machine "umask 077 && cd ${remote_aidedir} && ${remote_aidedir}/aide --config=${remote_aidedir}/aide.conf 2>&1 | tee ${remote_aidedir}/report >> /dev/null" + + # Copy output back to file + if test ! -d ${aidedir}/reports/${date} ; then + mkdir ${aidedir}/reports/${date} + fi + scp -q ${userid}@${machine}:${remote_aidedir}/report $reports/${machine} + +} + +### +### The program +### + +# From the commandline +case $# in + 2) mode=$1; thehosts=$2 ;; + *) usage; exit 1 ;; +esac + +# Set mode specific variables +case $mode in + -init) initlogs=${aidedir}/reports/initlogs + inittmp=${tmpdir}/initoutput/${date} + mail_fordir=${inittmp} ;; + -check) reports=${aidedir}/reports/${date} + mail_fordir=${reports} ;; +esac + +# +case $thehosts in + ALL) forcmd=`ls ${clientdir}` ;; + *) forcmd=$thehosts ;; +esac + +for machine in $forcmd ; do + sleep 2 # so we get a different random word + + ( ## background it (this is so it runs in parellel) + + # Set up local directories and files for use + config=${clientdir}/${machine}/aide.conf + db=${clientdir}/${machine}/aide.db_${machine} + binary=${clientdir}/${machine}/aide + log=${clientdir}/${machine}/log + sshaide_conf=${clientdir}/${machine}/sshaide.conf + + # Set up temporary directory name for remote machine + rand_word=`gen_rand_word` + + # Apply client host configuration options + if test ! -r ${sshaide_conf} ; then + remote_aidedir=${homedefault}/${rand_word}.$$ + mailrcpts=${maildefault} + userid=${useriddefault} + else + # Get the email addresses to send reports to + grep '^emaillist' ${sshaide_conf} + if [ $? != 0 ] ; then + mailrcpts=${maildefault} + else + mailrcpts=`grep -m1 '^emaillist' ${sshaide_conf} | \ + awk '{print $2}'` + fi + # Get the remote user id + grep '^userid' ${sshaide_conf} + if [ $? != 0 ] ; then + userid=${useriddefault} + else + userid=`grep -m1 '^userid' ${sshaide_conf} | \ + awk '{print $2}'` + fi + # Get home directory to use on remote machine + grep '^homedir' ${sshaide_conf} + if [ $? != 0 ] ; then + remote_aidedir=/home/${userid}/${rand_word}.$$ + else + remote_aidedir=`grep -m1 '^homedir' ${sshaide_conf} | \ + awk '{print $2}'`/${rand_word}.$$ + fi + fi + + # Do the dirty work + ssh -l $userid $machine "mkdir -p $remote_aidedir" + scp -q $config ${userid}@${machine}:${remote_aidedir} + scp -q $binary ${userid}@${machine}:${remote_aidedir} + + case $mode in + -init) init_cmds ;; + -check) check_cmds ;; + esac + + # Delete remote directory + ssh -l $userid $machine "rm -rf $remote_aidedir" + + # If $mail_fordir doesn't exist, don't continue + if test ! -d "${mail_fordir}" ; then + echo "${progname}:${mail_fordir} doesn't exist," + echo "exiting now, not sending mail" + exit 1 + fi + + ### + ### Mail reports out + ### + + cat ${mail_fordir}/${machine} \ + | mail -s "### AIDE ${mode} ${machine} ${date}" ${mailrcpts} + + ) +done + +# Wait for all bg processes to finish before continuing +wait + +# Tar and compress the reports +if test $mode = -check ; then + tar cf ${reports}.tar ${reports} + rm -rf ${reports} + gzip -9 ${reports}.tar +fi + +# If mode is check, examine clientdir for reinit file, and +# reinitialize if it exists + +if test $mode = -check ; then + for host in $forcmd ; do + if test -w ${clientdir}/${host}/reinit ; then + ${aidedir}/bin/${progname} -init ${host} & + rm ${clientdir}/${host}/reinit + fi + done +fi + +### +### Clean up init stuff +### + +if test $mode = -init ; then + + # Concatenate inittmp directories into initlogs + for host in `ls -A ${mail_fordir}` ; do + ( + echo "********************************************" + echo ${host} $date ${mode} + echo "********************************************" + echo "" + cat ${mail_fordir}/${host} + echo "" + )| tee -a $initlogs/`date +%Y-%m` >> /dev/null + done + + # Delete inittmp directory + rm -rf ${tmpdir}/initoutput +fi diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..fc98710 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/aide.1 b/doc/aide.1 new file mode 100644 index 0000000..c3d52a7 --- /dev/null +++ b/doc/aide.1 @@ -0,0 +1,121 @@ +.TH AIDE 1 "Jul 25, 2016" "aide 0.16" "User Commands" +.SH NAME +\fBaide\fP \- Advanced Intrusion Detection Environment +.SH SYNOPSIS +\fBaide\fP +\%[\fBparameters\fP] +\%\fBcommand\fP +.SH DESCRIPTION +\fBAIDE\fP is an intrusion detection system for checking the integrity +of files. + +.SH COMMANDS +.PP +.IP "--check, -C" +Checks the database for inconsistencies. You must have an initialized +database to do this. This is also the default command. Without any +command \fBaide\fP does a check. +.IP "--init, -i" +Initialize the database. You must initialize a database and move it to +the appropriate place before you can use the \-\-check command. +.IP "--update, -u" +Checks the database and updates the database non-interactively. +The input and output databases must be different. +.IP "--compare, -E" +Compares two databases. They must be defined in config file with +database= and database_new=. +.IP "--config-check, -D" +Stops after reading in the configuration file. Any errors will be reported. +If \fBaide\fP was compiled with the \(dq\fB--with-dbhmackey\fR\(dq option, +a hash for the config file will be calculated. See the AIDE manual for more +information. +.SH PARAMETERS +.IP "--config=\fBconfigfile\fR , -c \fBconfigfile\fR" +Configuration is read from file \fBconfigfile\fR instead of "./aide.conf". Use '-' for stdin. +.IP "--limit=\fBREGEX\fR , -l \fBREGEX\fR" +Limit command to entries matching REGEX. Note that the REGEX only matches +at the first position. + +.RS +.B Example +.RS 3 +Only check and update the database entries matching /etc (i.e. the /etc +directory) while leaving all other entries unchecked and unchanged: + +.RS 3 +.nf +aide --update --limit /etc +.fi +.RE +.RE +.RE + +.IP "--before=\(dq\fBconfigparameters\fR\(dq , -B \(dq\fBconfigparameters\fR\(dq" +These \fBconfigparameters\fR are handled before the reading of the +configuration file. See aide.conf (5) for more details on what to put +here. +.IP "--after=\(dq\fBconfigparameters\fR\(dq , -A \(dq\fBconfigparameters\fR\(dq" +These \fBconfigparameters\fR are handled after the reading of the +configuration file. See aide.conf (5) for more details on what to put +here. +.IP --verbose=\fBverbosity_level\fR,-V\fBverbosity_level\fR +Controls how verbose \fBaide\fP is. Value must [0-255]. The default is +5. With no argument Value is set to 20. This parameter overrides the +value set in a configuration file. +.IP "--report=\fBreporter\fR,-r \fBreporter\fR" +\fBreporter\fR is a URL which tells \fBaide\fP where to send it's +output. See aide.conf (5) section URLS for available values. +.IP "--version,-v" +\fBaide\fP prints out its version number +.IP "--help,-h" +Prints out the standard help message. +.PP +.SH DIAGNOSTICS +Normally, the exit status is 0 if no errors occurred. Except when the +.BR --check , +.BR --compare " or" +.B --update +command was requested, in which case the exit status is defined as: +.IP "1 * (new files detected?) +" +.IP "2 * (removed files detected?) +" +.IP "4 * (changed files detected?)" +.PP +Additionally, the following exit codes are defined for generic error +conditions: +.IP "14 Error writing error" +.IP "15 Invalid argument error" +.IP "16 Unimplemented function error" +.IP "17 Invalid configureline error" +.IP "18 IO error" +.IP "19 Version mismatch error" +.PP +.SH NOTES +Please note that due to mmap issues, aide cannot be terminated with +SIGTERM. Use SIGKILL to terminate. + +The checksums in the database and in the output are by default base64 +encoded (see also report_base16 option). +To decode them you can use the following shell command: + +echo | base64 \-d | hexdump \-v \-e '32/1 "%02x" "\\n"' + +.PP +.SH FILES +.IP \fB${prefix}/etc/aide.conf\fR +Default aide configuration file. +.IP \fB${prefix}/etc/aide.db\fR +Default aide database. +.IP \fB${prefix}/etc/aide.db.new\fR +Default aide output database. +.SH SEE ALSO +.BR aide.conf (5) +.BR manual.html +.SH BUGS +There are probably bugs in this release. Please report them +at http://sourceforge.net/projects/aide . Bug fixes are more than welcome. +Unified diffs are preferred. +.SH DISCLAIMER +All trademarks are the property of their respective owners. +No animals were harmed while making this webpage or this piece of +software. Although some pizza delivery guy's feelings were hurt. +.BR diff --git a/doc/aide.1.in b/doc/aide.1.in new file mode 100644 index 0000000..e60858d --- /dev/null +++ b/doc/aide.1.in @@ -0,0 +1,121 @@ +.TH AIDE 1 "Jul 25, 2016" "aide 0.16" "User Commands" +.SH NAME +\fBaide\fP \- Advanced Intrusion Detection Environment +.SH SYNOPSIS +\fBaide\fP +\%[\fBparameters\fP] +\%\fBcommand\fP +.SH DESCRIPTION +\fBAIDE\fP is an intrusion detection system for checking the integrity +of files. + +.SH COMMANDS +.PP +.IP "--check, -C" +Checks the database for inconsistencies. You must have an initialized +database to do this. This is also the default command. Without any +command \fBaide\fP does a check. +.IP "--init, -i" +Initialize the database. You must initialize a database and move it to +the appropriate place before you can use the \-\-check command. +.IP "--update, -u" +Checks the database and updates the database non-interactively. +The input and output databases must be different. +.IP "--compare, -E" +Compares two databases. They must be defined in config file with +database= and database_new=. +.IP "--config-check, -D" +Stops after reading in the configuration file. Any errors will be reported. +If \fBaide\fP was compiled with the \(dq\fB--with-dbhmackey\fR\(dq option, +a hash for the config file will be calculated. See the AIDE manual for more +information. +.SH PARAMETERS +.IP "--config=\fBconfigfile\fR , -c \fBconfigfile\fR" +Configuration is read from file \fBconfigfile\fR instead of "./aide.conf". Use '-' for stdin. +.IP "--limit=\fBREGEX\fR , -l \fBREGEX\fR" +Limit command to entries matching REGEX. Note that the REGEX only matches +at the first position. + +.RS +.B Example +.RS 3 +Only check and update the database entries matching /etc (i.e. the /etc +directory) while leaving all other entries unchecked and unchanged: + +.RS 3 +.nf +aide --update --limit /etc +.fi +.RE +.RE +.RE + +.IP "--before=\(dq\fBconfigparameters\fR\(dq , -B \(dq\fBconfigparameters\fR\(dq" +These \fBconfigparameters\fR are handled before the reading of the +configuration file. See aide.conf (5) for more details on what to put +here. +.IP "--after=\(dq\fBconfigparameters\fR\(dq , -A \(dq\fBconfigparameters\fR\(dq" +These \fBconfigparameters\fR are handled after the reading of the +configuration file. See aide.conf (5) for more details on what to put +here. +.IP --verbose=\fBverbosity_level\fR,-V\fBverbosity_level\fR +Controls how verbose \fBaide\fP is. Value must [0-255]. The default is +5. With no argument Value is set to 20. This parameter overrides the +value set in a configuration file. +.IP "--report=\fBreporter\fR,-r \fBreporter\fR" +\fBreporter\fR is a URL which tells \fBaide\fP where to send it's +output. See aide.conf (5) section URLS for available values. +.IP "--version,-v" +\fBaide\fP prints out its version number +.IP "--help,-h" +Prints out the standard help message. +.PP +.SH DIAGNOSTICS +Normally, the exit status is 0 if no errors occurred. Except when the +.BR --check , +.BR --compare " or" +.B --update +command was requested, in which case the exit status is defined as: +.IP "1 * (new files detected?) +" +.IP "2 * (removed files detected?) +" +.IP "4 * (changed files detected?)" +.PP +Additionally, the following exit codes are defined for generic error +conditions: +.IP "14 Error writing error" +.IP "15 Invalid argument error" +.IP "16 Unimplemented function error" +.IP "17 Invalid configureline error" +.IP "18 IO error" +.IP "19 Version mismatch error" +.PP +.SH NOTES +Please note that due to mmap issues, aide cannot be terminated with +SIGTERM. Use SIGKILL to terminate. + +The checksums in the database and in the output are by default base64 +encoded (see also report_base16 option). +To decode them you can use the following shell command: + +echo | base64 \-d | hexdump \-v \-e '32/1 "%02x" "\\n"' + +.PP +.SH FILES +.IP \fB@sysconfdir@/aide.conf\fR +Default aide configuration file. +.IP \fB@sysconfdir@/aide.db\fR +Default aide database. +.IP \fB@sysconfdir@/aide.db.new\fR +Default aide output database. +.SH SEE ALSO +.BR aide.conf (5) +.BR manual.html +.SH BUGS +There are probably bugs in this release. Please report them +at http://sourceforge.net/projects/aide . Bug fixes are more than welcome. +Unified diffs are preferred. +.SH DISCLAIMER +All trademarks are the property of their respective owners. +No animals were harmed while making this webpage or this piece of +software. Although some pizza delivery guy's feelings were hurt. +.BR diff --git a/doc/aide.conf.5 b/doc/aide.conf.5 new file mode 100644 index 0000000..240f4c6 --- /dev/null +++ b/doc/aide.conf.5 @@ -0,0 +1,497 @@ +.TH AIDE.CONF 5 "Jul 25, 2016" "aide 0.16" "AIDE" +.SH NAME +aide.conf - The configuration file for Advanced Intrusion Detection +Environment +.PP +.SH SYNOPSIS +\fBaide.conf\fP is the configuration file for Advanced Intrusion +Detection Environment. \fBaide.conf\fP contains the runtime +configuration aide uses to initialize or check the AIDE database. +.PP +.SH "FILE FORMAT" +\fBaide.conf\fP is similar in to Tripwire(tm)'s configuration +file. With little effort tw.conf can be converted to aide.conf. +.PP +aide.conf is case-sensitive. Leading and trailing white spaces are +ignored. +.PP +There are three types of lines in \fBaide.conf\fP. First there are the +configuration lines which are used to set configuration parameters and +define/undefine variables. Second, there are (restricted) selection lines that +are used to indicate which files are added to the database. Third, macro lines +define or undefine variables within the config file. Lines beginning with # +are ignored as comments. +.PP +.SH "CONFIG LINES" +.PP +These lines have the format parameter=value. See URLS for a list of +valid urls. +.PP +.IP "database" +The url from which database is read. There can only be one of these +lines. If there are multiple database lines then the first is used. +The default value is "/usr/local/etc/aide.db". +.IP "database_out" +The url to which the new database is written to. There can only be one +of these lines. If there are multiple database_out lines then the +first is used. The default value is "/usr/local/etc/aide.db.new". +.IP "database_new" +The url from which the other database for \-\-compare is read. +There is no default for this one. +.IP "database_attrs" +The attributes of the (uncompressed) database files which are to be added to +the final report in verbose level 2 or higher. Only checksum attributes are +supported. To disable set +.I database_attrs +to +.RB ' E '. +By default all compiled in checksums are added to the report. +.IP "database_add_metadata" +Whether to add the AIDE version and the time of database generation as comments +to the database file or not. Valid values are yes, true, no and false. The +default is to add the AIDE version and the time of database generation. This +option may be set to no by default in a future release. +.IP "verbose" +The level of messages that is output. This value can be 0-255 +inclusive. This parameter can only be given once. Value from the first +occurrence is used. If \-\-verbose or \-V is used then the value from that +is used. The default is 5. If verbosity is 20 then additional report +output is written when doing \-\-check, \-\-update or \-\-compare. +.IP "report_url" +The url that the output is written to. There can be multiple instances +of this parameter. Output is written to all of them. The default is +stdout. +.IP "report_base16" +Whether to base16 encode the checksums in the report or not. Valid values are +yes, true, no and false. The default is to report checksums not in base16 but +in base64 encoding. +.IP "report_detailed_init" +Whether to report added files (verbose level >= 2) and their details (verbose +level >=7) in initialization mode or not. Valid values are yes, true, no and +false. The default is to not report added files or their details in init mode. +.IP "report_quiet" +Whether to suppress report output if no differences to the database have been +found or not. Valid values are yes, true, no and false. The default is to not +suppress output in the report. +.IP "gzip_dbout" +Whether the output to the database is gzipped or not. Valid values are +yes,true,no and false. The default is no. This option is available only +if zlib support is compiled in. +.IP "root_prefix" +The prefix to strip from each file name in the file system before applying the +rules and writing to database. AIDE removes a trailing slash from the prefix. +The default is no (an empty) prefix. This option has no effect in +compare mode. +.IP "acl_no_symlink_follow" +Whether to check ACLs for symlinks or not. Valid values are +yes,true,no and false. The default is to follow symlinks. This option +is available only if acl support is compiled in. +.IP "warn_dead_symlinks" +Whether to warn about dead symlinks or not. Valid values are +yes,true,no and false. The default is not to warn about dead symlinks. +.IP "grouped" +Whether to group the files in the report by added, removed and changed +files or not. Valid values are yes, true, no and false. +The default is to group the files in the report. +.IP "summarize_changes" +Whether to summarize changes in the added, removed and changed files +sections of the report or not. Valid values are yes,true,no and false. +The default is to summarize the changes. + +The general format is like the string YlZbpugamcinCAXSE, where Y is +replaced by the file-type (\fBf\fP for a regular file, \fBd\fP for a +directory, \fBl\fP for a symbolic link, \fBc\fP for a character device, +\fBb\fP for a block device, \fBp\fP for a FIFO, \fBs\fP for a unix +socket, \fBD\fP for a Solaris door, \fBP\fP for a Solaris event port, \fB!\fP +if file type has changed and \fB?\fP otherwise). + +The Z is replaced as follows: A \fB=\fP means that the size has not changed, +a \fB<\fP reports a shrinked size and a \fB>\fP reports a grown size. + +The other letters in the string are the actual letters that will be output +if the associated attribute for the item has been changed or a "." for no +change, a "+" if the attribute has been added, a "-" if it has been removed, +a ":" if the attribute is ignored (but not forced) or a " " if the attribute has +not been checked. The exceptions to this are: (1) a newly created file replaces +each letter with a "+", and (2) a removed file replaces each letter with a "-". + +The attribute that is associated with each letter is as follows: + +.RS +.IP o +A \fBl\fP means that the link name has changed. +.IP o +A \fBb\fP means that the block count has changed. +.IP o +A \fBp\fP means that the permissions have changed. +.IP o +An \fBu\fP means that the uid has changed. +.IP o +A \fBg\fP means that the gid has changed. +.IP o +An \fBa\fP means that the access time has changed. +.IP o +A \fBm\fP means that the modification time has changed. +.IP o +A \fBc\fP means that the change time has changed. +.IP o +An \fBi\fP means that the inode has changed. +.IP o +A \fBn\fP means that the link count has changed. +.IP o +A \fBC\fP means that one or more checksums have changed. +.RE + +.RS +The following letters are only available when explicitly enabled using configure: +.RE + +.RS +.IP o +A \fBA\fP means that the access control list has changed. +.IP o +A \fBX\fP means that the extended attributes have changed. +.IP o +A \fBS\fP means that the SELinux attributes have changed. +.IP o +A \fBE\fP means that the file attributes on a second extended file system have changed. +.RE +.IP "report_ignore_added_attrs" +Special group definition that lists attributes whose addition is to be ignored +in the final report. +.IP "report_ignore_removed_attrs" +Special group definition that lists attributes whose removal is to be ignored +in the final report. +.TP +report_ignore_changed_attrs +.TQ +ignore_list (DEPRECATED, will be removed in a future release) +Special group definition that lists attributes whose change is to be ignored +in the final report. +.TP +report_force_attrs +.TQ +report_attributes (DEPRECATED, will be removed in a future release) +Special group definition that lists attributes which are always printed in the +final report for changed files. If an attribute is both ignored and forced the +attribute is not considered for file change but printed in the final report if +the file has been otherwise changed. +.IP "report_ignore_e2fsattrs" +List (no delimiter) of ext2 file attributes which are to be ignored in the final report. +See +.BR chattr (1) +for the available attributes. Use '0' to not ignore any +attribute. Ignored attributes are represented by a ':' in the output. The +default is to not ignore any ext2 file attribute. + +.RS +.B Example +.RS 3 +Ignore changes of the ext2 file attributes compression error (E), huge file +(h), indexed directory (I): + +.RS 3 +.nf +report_ignore_e2fsattrs=EhI +.fi +.RE +.RE +.RE +.IP "config_version" +The value of config_version is printed in the report and also printed +to the database. This is for informational purposes only. It has no +other functionality. +.IP "Group definitions" +If the parameter is not one of the previous parameters then it is +regarded as a group definition. Value is then regarded as an +expression. Expression is of the following form. +.IP +.nf + | + + | - +.fi +.IP +See DEFAULT GROUPS for an explanation of default predefined groups. +Note that this is different from the way Tripwire(tm) does it. +.PP +.SH "SELECTION LINES" +.PP +AIDE supports three types of selection lines: + +Regular selection line: +.RS 3 + +.nf +.B +.fi + +Files and directories matching the regular expression are added to the +database. + +.RE + +Negative selection line: +.RS 3 + +.nf +.B ! +.fi + +Files and directories matching the regular expression are ignored and not added +to the database. + +.RE + +Equals selection line: +.RS 3 + +.nf +.B = +.fi + +Files and directories matching the regular expression are added to the +database. The children of directories are only added if the regular expression +ends with a "/". The children of sub-directories are not added at all. + +.RE + +Every regular expression has to start with a "/". An implicit ^ is added in +front of each regular expression. In other words the regular expressions are +matched at the first position against the complete filename (i.e. including the +path). Special characters in your filenames can be escaped using two-digit URL +encoding (for example, %20 to represent a space). + +See EXAMPLES and doc/aide.conf for examples. +.PP +More in-depth discussion of the selection algorithm can be found in +the AIDE manual. +.IP +.PP +.SH "RESTRICTED SELECTION LINES" +.PP +Restricted selection lines are like normal selection lines but can be +restricted to file types. The following file types are supported: + +.RS + +\fBf\fP: restrict rule to regular files + +\fBd\fP: restrict rule to directories + +\fBl\fP: restrict rule to symbolic links + +\fBc\fP: restrict rule to character devices + +\fBb\fP: restrict rule to block devices + +\fBp\fP: restrict rule to FIFO files + +\fBs\fP: restrict rule to UNIX sockets + +\fBD\fP: restrict rule to Solaris doors + +\fBP\fP: restrict rule to Solaris event ports +.RE + +The file types are separated by comma. The syntax of restricted +selection lines is as follows: + +Restricted regular selection line: +.RS 3 +.nf +.B +.fi +.RE + +Restricted negative selection line: +.RS 3 +.nf +.B ! +.fi +.RE + +Restricted equals selection line: +.RS 3 +.nf +.B = +.fi +.RE + +.B Examples +.RS 3 +Only add directories and files to the database: + +.RS 3 +.nf +.B / d,f R +.fi +.RE +.RE + +.RS 3 +Add all but directory entries to the database: + +.RS 3 +.nf +.B !/run d +.B /run R +.fi +.RE +.RE + +.RS 3 +Use specific rule for directories: + +.RS 3 +.nf +.B /run d R-m-c-i +.B /run R +.fi +.RE +.RE + +.PP +.SH "MACRO LINES" +.PP +.IP "@@define \fBVAR\fR \fBval\fR" +Define variable \fBVAR\fR to value \fBval\fR. +.IP "@@undef \fBVAR\fR" +Undefine variable \fBVAR\fR. +.IP "@@ifdef \fBVAR\fR, @@ifndef \fBVAR\fR" +@@ifdef begins an if statement. It must be terminated with an @@endif +statement. The lines between @@ifdef and @@endif are used if variable +\fBVAR\fR is defined. If there is an @@else statement then the part +between @@ifdef and @@else is used is \fBVAR\fR is defined otherwise +the part between @@else and @@endif is used. @@ifndef reverses the +logic of @@ifdef statement but otherwise works similarly. +.IP "@@ifhost \fBhostname\fR, @@ifnhost \fBhostname\fR" +@@ifhost works like @@ifdef only difference is that it checks whether +\fBhostname\fR equals the name of the host that AIDE is running on. +\fBhostname\fR is the name of the host without the domainname +(hostname, not hostname.example.com). +.IP "@@{\fBVAR\fR}" +@@{\fBVAR\fR} is replaced with the value of the variable \fBVAR\fR. +If variable \fBVAR\fR is not defined an empty string is used. Unlike +Tripwire(tm) @@VAR is NOT supported. One special \fBVAR\fR is @@{HOSTNAME} +which is substituted for the hostname of the current system. +.IP "@@else" +Begins the else part of an if statement. +.IP "@@endif" +Ends an if statement. +.IP "@@include \fBVAR\fR" +Includes the file \fBVAR\fR. The content of the file is used as if it +were inserted in this part of the config file. +.PP +.SH URLS +Urls can be one of the following. Input urls cannot be used as outputs +and vice versa. +.IP "stdout" +.IP "stderr" +Output is sent to stdout,stderr respectively. +.IP "stdin" +Input is read from stdin. +.IP "file://\fBfilename\fR" +Input is read from \fBfilename\fR or output is written to +\fBfilename\fR. +.IP "fd:\fBnumber\fR" +Input is read from filedescriptor \fBnumber\fR or output is written to +\fBnumber\fR. +.PP +.SH "DEFAULT GROUPS" +.PP +.IP "p: permissions" +.IP "ftype: file type" +.IP "i: inode" +.IP "l: link name" +.IP "n: number of links" +.IP "u: user" +.IP "g: group" +.IP "s: size" +.IP "b: block count" +.IP "m: mtime" +.IP "a: atime" +.IP "c: ctime" +.IP "S: check for growing size" +.IP "I: ignore changed filename" +.IP "ANF: allow new files +.IP "ARF: allow removed files +.IP "md5: md5 checksum" +.IP "sha1: sha1 checksum" +.IP "sha256: sha256 checksum" +.IP "sha512: sha512 checksum" +.IP "rmd160: rmd160 checksum" +.IP "tiger: tiger checksum" +.IP "haval: haval checksum" +.IP "crc32: crc32 checksum" +.IP "R: p+ftype+i+l+n+u+g+s+m+c+md5+X" +.IP "L: p+ftype+i+l+n+u+g+X" +.IP "E: Empty group" +.IP "X: acl+selinux+xattrs+e2fsattrs (if groups are explicitly enabled)" +.IP ">: Growing file p+ftype+l+u+g+i+n+S+X" +.LP +And also the following if you have mhash support enabled +.IP "gost: gost checksum" +.IP "whirlpool: whirlpool checksum" +.LP +The following are available only when explicitly enabled using configure +.IP "acl: access control list" +.IP "selinux: selinux attributes" +.IP "xattrs: extended attributes" +.IP "e2fsattrs: file attributes on a second extended file system +.LP +Please note that 'I' and 'c' are incompatible. When the name of a file +is changed, it's ctime is updated as well. When you put 'c' and 'I' in +the same rule the, a changed ctime is silently ignored. +.LP +When 'ANF' is used, new files are added to the new database, but are +ignored in the report. +.LP +When 'ARF' is used, files missing on disk are omitted from the new database, +but are ignored in the report. +.PP +.SH EXAMPLES +.IP +.B "/ R" +.LP +This adds all files on your machine to the database. This one line +is a fully qualified configuration file. +.IP +.B "!/dev" +.LP +This ignores the /dev directory structure. +.IP +.B "=/foo R" +.LP +Only /foo and /foobar are taken into the database. None of their children are +added. +.IP +.B "=/foo/ R" +.LP +Only /foo and its children (e.g. /foo/file and /foo/directory) are taken into +the database. The children of sub-directories (e.g. /foo/directory/bar) are not +added. +.IP +.B "\fBAll\fR=p+i+n+u+g+s+m+c+a+md5+sha1+tiger+rmd160" +.LP +This line defines group \fBAll\fR. It has all attributes and all +md checksum functions. If you absolutely want all digest functions +then you should enable mhash support and add ++crc32+haval+gost to the end of the definition for +\fBAll\fR. Mhash support can only be enabled at compile-time. +.PP +.SH HINTS +In the following, the first is not allowed in AIDE. Use the latter instead. +.IP +.B "/foo epug" +.IP +.B "/foo e+p+u+g" +.PP +.SH "SEE ALSO" +.BR aide (1) +.BR manual.html +.SH DISCLAIMER +All trademarks are the property of their respective owners. +No animals were harmed while making this webpage or this piece of +software. + + diff --git a/doc/aide.conf.5.in b/doc/aide.conf.5.in new file mode 100644 index 0000000..0ca8f6b --- /dev/null +++ b/doc/aide.conf.5.in @@ -0,0 +1,497 @@ +.TH AIDE.CONF 5 "Jul 25, 2016" "aide 0.16" "AIDE" +.SH NAME +aide.conf - The configuration file for Advanced Intrusion Detection +Environment +.PP +.SH SYNOPSIS +\fBaide.conf\fP is the configuration file for Advanced Intrusion +Detection Environment. \fBaide.conf\fP contains the runtime +configuration aide uses to initialize or check the AIDE database. +.PP +.SH "FILE FORMAT" +\fBaide.conf\fP is similar in to Tripwire(tm)'s configuration +file. With little effort tw.conf can be converted to aide.conf. +.PP +aide.conf is case-sensitive. Leading and trailing white spaces are +ignored. +.PP +There are three types of lines in \fBaide.conf\fP. First there are the +configuration lines which are used to set configuration parameters and +define/undefine variables. Second, there are (restricted) selection lines that +are used to indicate which files are added to the database. Third, macro lines +define or undefine variables within the config file. Lines beginning with # +are ignored as comments. +.PP +.SH "CONFIG LINES" +.PP +These lines have the format parameter=value. See URLS for a list of +valid urls. +.PP +.IP "database" +The url from which database is read. There can only be one of these +lines. If there are multiple database lines then the first is used. +The default value is "@prefix@/etc/aide.db". +.IP "database_out" +The url to which the new database is written to. There can only be one +of these lines. If there are multiple database_out lines then the +first is used. The default value is "@prefix@/etc/aide.db.new". +.IP "database_new" +The url from which the other database for \-\-compare is read. +There is no default for this one. +.IP "database_attrs" +The attributes of the (uncompressed) database files which are to be added to +the final report in verbose level 2 or higher. Only checksum attributes are +supported. To disable set +.I database_attrs +to +.RB ' E '. +By default all compiled in checksums are added to the report. +.IP "database_add_metadata" +Whether to add the AIDE version and the time of database generation as comments +to the database file or not. Valid values are yes, true, no and false. The +default is to add the AIDE version and the time of database generation. This +option may be set to no by default in a future release. +.IP "verbose" +The level of messages that is output. This value can be 0-255 +inclusive. This parameter can only be given once. Value from the first +occurrence is used. If \-\-verbose or \-V is used then the value from that +is used. The default is 5. If verbosity is 20 then additional report +output is written when doing \-\-check, \-\-update or \-\-compare. +.IP "report_url" +The url that the output is written to. There can be multiple instances +of this parameter. Output is written to all of them. The default is +stdout. +.IP "report_base16" +Whether to base16 encode the checksums in the report or not. Valid values are +yes, true, no and false. The default is to report checksums not in base16 but +in base64 encoding. +.IP "report_detailed_init" +Whether to report added files (verbose level >= 2) and their details (verbose +level >=7) in initialization mode or not. Valid values are yes, true, no and +false. The default is to not report added files or their details in init mode. +.IP "report_quiet" +Whether to suppress report output if no differences to the database have been +found or not. Valid values are yes, true, no and false. The default is to not +suppress output in the report. +.IP "gzip_dbout" +Whether the output to the database is gzipped or not. Valid values are +yes,true,no and false. The default is no. This option is available only +if zlib support is compiled in. +.IP "root_prefix" +The prefix to strip from each file name in the file system before applying the +rules and writing to database. AIDE removes a trailing slash from the prefix. +The default is no (an empty) prefix. This option has no effect in +compare mode. +.IP "acl_no_symlink_follow" +Whether to check ACLs for symlinks or not. Valid values are +yes,true,no and false. The default is to follow symlinks. This option +is available only if acl support is compiled in. +.IP "warn_dead_symlinks" +Whether to warn about dead symlinks or not. Valid values are +yes,true,no and false. The default is not to warn about dead symlinks. +.IP "grouped" +Whether to group the files in the report by added, removed and changed +files or not. Valid values are yes, true, no and false. +The default is to group the files in the report. +.IP "summarize_changes" +Whether to summarize changes in the added, removed and changed files +sections of the report or not. Valid values are yes,true,no and false. +The default is to summarize the changes. + +The general format is like the string YlZbpugamcinCAXSE, where Y is +replaced by the file-type (\fBf\fP for a regular file, \fBd\fP for a +directory, \fBl\fP for a symbolic link, \fBc\fP for a character device, +\fBb\fP for a block device, \fBp\fP for a FIFO, \fBs\fP for a unix +socket, \fBD\fP for a Solaris door, \fBP\fP for a Solaris event port, \fB!\fP +if file type has changed and \fB?\fP otherwise). + +The Z is replaced as follows: A \fB=\fP means that the size has not changed, +a \fB<\fP reports a shrinked size and a \fB>\fP reports a grown size. + +The other letters in the string are the actual letters that will be output +if the associated attribute for the item has been changed or a "." for no +change, a "+" if the attribute has been added, a "-" if it has been removed, +a ":" if the attribute is ignored (but not forced) or a " " if the attribute has +not been checked. The exceptions to this are: (1) a newly created file replaces +each letter with a "+", and (2) a removed file replaces each letter with a "-". + +The attribute that is associated with each letter is as follows: + +.RS +.IP o +A \fBl\fP means that the link name has changed. +.IP o +A \fBb\fP means that the block count has changed. +.IP o +A \fBp\fP means that the permissions have changed. +.IP o +An \fBu\fP means that the uid has changed. +.IP o +A \fBg\fP means that the gid has changed. +.IP o +An \fBa\fP means that the access time has changed. +.IP o +A \fBm\fP means that the modification time has changed. +.IP o +A \fBc\fP means that the change time has changed. +.IP o +An \fBi\fP means that the inode has changed. +.IP o +A \fBn\fP means that the link count has changed. +.IP o +A \fBC\fP means that one or more checksums have changed. +.RE + +.RS +The following letters are only available when explicitly enabled using configure: +.RE + +.RS +.IP o +A \fBA\fP means that the access control list has changed. +.IP o +A \fBX\fP means that the extended attributes have changed. +.IP o +A \fBS\fP means that the SELinux attributes have changed. +.IP o +A \fBE\fP means that the file attributes on a second extended file system have changed. +.RE +.IP "report_ignore_added_attrs" +Special group definition that lists attributes whose addition is to be ignored +in the final report. +.IP "report_ignore_removed_attrs" +Special group definition that lists attributes whose removal is to be ignored +in the final report. +.TP +report_ignore_changed_attrs +.TQ +ignore_list (DEPRECATED, will be removed in a future release) +Special group definition that lists attributes whose change is to be ignored +in the final report. +.TP +report_force_attrs +.TQ +report_attributes (DEPRECATED, will be removed in a future release) +Special group definition that lists attributes which are always printed in the +final report for changed files. If an attribute is both ignored and forced the +attribute is not considered for file change but printed in the final report if +the file has been otherwise changed. +.IP "report_ignore_e2fsattrs" +List (no delimiter) of ext2 file attributes which are to be ignored in the final report. +See +.BR chattr (1) +for the available attributes. Use '0' to not ignore any +attribute. Ignored attributes are represented by a ':' in the output. The +default is to not ignore any ext2 file attribute. + +.RS +.B Example +.RS 3 +Ignore changes of the ext2 file attributes compression error (E), huge file +(h), indexed directory (I): + +.RS 3 +.nf +report_ignore_e2fsattrs=EhI +.fi +.RE +.RE +.RE +.IP "config_version" +The value of config_version is printed in the report and also printed +to the database. This is for informational purposes only. It has no +other functionality. +.IP "Group definitions" +If the parameter is not one of the previous parameters then it is +regarded as a group definition. Value is then regarded as an +expression. Expression is of the following form. +.IP +.nf + | + + | - +.fi +.IP +See DEFAULT GROUPS for an explanation of default predefined groups. +Note that this is different from the way Tripwire(tm) does it. +.PP +.SH "SELECTION LINES" +.PP +AIDE supports three types of selection lines: + +Regular selection line: +.RS 3 + +.nf +.B +.fi + +Files and directories matching the regular expression are added to the +database. + +.RE + +Negative selection line: +.RS 3 + +.nf +.B ! +.fi + +Files and directories matching the regular expression are ignored and not added +to the database. + +.RE + +Equals selection line: +.RS 3 + +.nf +.B = +.fi + +Files and directories matching the regular expression are added to the +database. The children of directories are only added if the regular expression +ends with a "/". The children of sub-directories are not added at all. + +.RE + +Every regular expression has to start with a "/". An implicit ^ is added in +front of each regular expression. In other words the regular expressions are +matched at the first position against the complete filename (i.e. including the +path). Special characters in your filenames can be escaped using two-digit URL +encoding (for example, %20 to represent a space). + +See EXAMPLES and doc/aide.conf for examples. +.PP +More in-depth discussion of the selection algorithm can be found in +the AIDE manual. +.IP +.PP +.SH "RESTRICTED SELECTION LINES" +.PP +Restricted selection lines are like normal selection lines but can be +restricted to file types. The following file types are supported: + +.RS + +\fBf\fP: restrict rule to regular files + +\fBd\fP: restrict rule to directories + +\fBl\fP: restrict rule to symbolic links + +\fBc\fP: restrict rule to character devices + +\fBb\fP: restrict rule to block devices + +\fBp\fP: restrict rule to FIFO files + +\fBs\fP: restrict rule to UNIX sockets + +\fBD\fP: restrict rule to Solaris doors + +\fBP\fP: restrict rule to Solaris event ports +.RE + +The file types are separated by comma. The syntax of restricted +selection lines is as follows: + +Restricted regular selection line: +.RS 3 +.nf +.B +.fi +.RE + +Restricted negative selection line: +.RS 3 +.nf +.B ! +.fi +.RE + +Restricted equals selection line: +.RS 3 +.nf +.B = +.fi +.RE + +.B Examples +.RS 3 +Only add directories and files to the database: + +.RS 3 +.nf +.B / d,f R +.fi +.RE +.RE + +.RS 3 +Add all but directory entries to the database: + +.RS 3 +.nf +.B !/run d +.B /run R +.fi +.RE +.RE + +.RS 3 +Use specific rule for directories: + +.RS 3 +.nf +.B /run d R-m-c-i +.B /run R +.fi +.RE +.RE + +.PP +.SH "MACRO LINES" +.PP +.IP "@@define \fBVAR\fR \fBval\fR" +Define variable \fBVAR\fR to value \fBval\fR. +.IP "@@undef \fBVAR\fR" +Undefine variable \fBVAR\fR. +.IP "@@ifdef \fBVAR\fR, @@ifndef \fBVAR\fR" +@@ifdef begins an if statement. It must be terminated with an @@endif +statement. The lines between @@ifdef and @@endif are used if variable +\fBVAR\fR is defined. If there is an @@else statement then the part +between @@ifdef and @@else is used is \fBVAR\fR is defined otherwise +the part between @@else and @@endif is used. @@ifndef reverses the +logic of @@ifdef statement but otherwise works similarly. +.IP "@@ifhost \fBhostname\fR, @@ifnhost \fBhostname\fR" +@@ifhost works like @@ifdef only difference is that it checks whether +\fBhostname\fR equals the name of the host that AIDE is running on. +\fBhostname\fR is the name of the host without the domainname +(hostname, not hostname.example.com). +.IP "@@{\fBVAR\fR}" +@@{\fBVAR\fR} is replaced with the value of the variable \fBVAR\fR. +If variable \fBVAR\fR is not defined an empty string is used. Unlike +Tripwire(tm) @@VAR is NOT supported. One special \fBVAR\fR is @@{HOSTNAME} +which is substituted for the hostname of the current system. +.IP "@@else" +Begins the else part of an if statement. +.IP "@@endif" +Ends an if statement. +.IP "@@include \fBVAR\fR" +Includes the file \fBVAR\fR. The content of the file is used as if it +were inserted in this part of the config file. +.PP +.SH URLS +Urls can be one of the following. Input urls cannot be used as outputs +and vice versa. +.IP "stdout" +.IP "stderr" +Output is sent to stdout,stderr respectively. +.IP "stdin" +Input is read from stdin. +.IP "file://\fBfilename\fR" +Input is read from \fBfilename\fR or output is written to +\fBfilename\fR. +.IP "fd:\fBnumber\fR" +Input is read from filedescriptor \fBnumber\fR or output is written to +\fBnumber\fR. +.PP +.SH "DEFAULT GROUPS" +.PP +.IP "p: permissions" +.IP "ftype: file type" +.IP "i: inode" +.IP "l: link name" +.IP "n: number of links" +.IP "u: user" +.IP "g: group" +.IP "s: size" +.IP "b: block count" +.IP "m: mtime" +.IP "a: atime" +.IP "c: ctime" +.IP "S: check for growing size" +.IP "I: ignore changed filename" +.IP "ANF: allow new files +.IP "ARF: allow removed files +.IP "md5: md5 checksum" +.IP "sha1: sha1 checksum" +.IP "sha256: sha256 checksum" +.IP "sha512: sha512 checksum" +.IP "rmd160: rmd160 checksum" +.IP "tiger: tiger checksum" +.IP "haval: haval checksum" +.IP "crc32: crc32 checksum" +.IP "R: p+ftype+i+l+n+u+g+s+m+c+md5+X" +.IP "L: p+ftype+i+l+n+u+g+X" +.IP "E: Empty group" +.IP "X: acl+selinux+xattrs+e2fsattrs (if groups are explicitly enabled)" +.IP ">: Growing file p+ftype+l+u+g+i+n+S+X" +.LP +And also the following if you have mhash support enabled +.IP "gost: gost checksum" +.IP "whirlpool: whirlpool checksum" +.LP +The following are available only when explicitly enabled using configure +.IP "acl: access control list" +.IP "selinux: selinux attributes" +.IP "xattrs: extended attributes" +.IP "e2fsattrs: file attributes on a second extended file system +.LP +Please note that 'I' and 'c' are incompatible. When the name of a file +is changed, it's ctime is updated as well. When you put 'c' and 'I' in +the same rule the, a changed ctime is silently ignored. +.LP +When 'ANF' is used, new files are added to the new database, but are +ignored in the report. +.LP +When 'ARF' is used, files missing on disk are omitted from the new database, +but are ignored in the report. +.PP +.SH EXAMPLES +.IP +.B "/ R" +.LP +This adds all files on your machine to the database. This one line +is a fully qualified configuration file. +.IP +.B "!/dev" +.LP +This ignores the /dev directory structure. +.IP +.B "=/foo R" +.LP +Only /foo and /foobar are taken into the database. None of their children are +added. +.IP +.B "=/foo/ R" +.LP +Only /foo and its children (e.g. /foo/file and /foo/directory) are taken into +the database. The children of sub-directories (e.g. /foo/directory/bar) are not +added. +.IP +.B "\fBAll\fR=p+i+n+u+g+s+m+c+a+md5+sha1+tiger+rmd160" +.LP +This line defines group \fBAll\fR. It has all attributes and all +md checksum functions. If you absolutely want all digest functions +then you should enable mhash support and add ++crc32+haval+gost to the end of the definition for +\fBAll\fR. Mhash support can only be enabled at compile-time. +.PP +.SH HINTS +In the following, the first is not allowed in AIDE. Use the latter instead. +.IP +.B "/foo epug" +.IP +.B "/foo e+p+u+g" +.PP +.SH "SEE ALSO" +.BR aide (1) +.BR manual.html +.SH DISCLAIMER +All trademarks are the property of their respective owners. +No animals were harmed while making this webpage or this piece of +software. + + diff --git a/doc/aide.conf.in b/doc/aide.conf.in new file mode 100644 index 0000000..f967a01 --- /dev/null +++ b/doc/aide.conf.in @@ -0,0 +1,144 @@ +# +# AIDE @VERSION@ +# +# example configuration file +# +# IMPORTANT NOTE!! PLEASE READ +# +# This configuration file checks the integrity of the +# AIDE package. +# +# This file is not intended to be used as the primary aide.conf file for +# your system. This file is intended to be a showcase for different +# features for aide.conf file. +# +# WRITE YOUR OWN CONFIGURATION FILE AND UNDERSTAND WHAT YOU ARE WRITING +# +# +# Default values for the parameters are in comments before the +# corresponding line. +# + +@@define TOPDIR @abs_top_srcdir@ + +@@ifndef TOPDIR +@@define TOPDIR / +@@endif + +@@ifdef DEBUG +@@define DEBUG ison +@@undef NOT_DEBUG +@@else +@@define NOT_DEBUG true +@@undef DEBUG +@@endif + +@@ifhost korppi +@@define KORPPI yes +@@endif + +@@ifnhost ftp +@@define BUMMER true +@@endif + +# The location of the database to be read. +#database=file:aide.db +database=file:@@{TOPDIR}/doc/aide.db + +# The location of the database to be written. +#database_out=sql:host:port:database:login_name:passwd:table +#database_out=file:aide.db.new +database_out=file:aide.db.new + +# Whether to gzip the output to database +# gzip_dbout=no + +#verbose=5 +verbose=20 + +#report_url=stdout +#other possibilities +#report_url=stderr +#NOT IMPLEMENTED report_url=mailto:root@foo.com +#report_url=file:/tmp/some_file.txt +#report_url=syslog:LOG_AUTH +report_url=stdout + +# @@{TOPDIR} is replaced with @abs_top_srcdir@ when +# read by aide. +#p: permissions +#ftype: file type +#i: inode +#n: number of links +#l: link name +#u: user +#g: group +#s: size +#b: block count +#m: mtime +#a: atime +#c: ctime +#S: check for growing size +#I: ignore changed filename +#md5: md5 checksum +#sha1: sha1 checksum +#sha256: sha256 checksum +#sha512: sha512 checksum +#rmd160: rmd160 checksum +#tiger: tiger checksum +#haval: haval checksum +#crc32: crc32 checksum +#R: p+ftype+i+l+n+u+g+s+m+c+md5 +#L: p+ftype+i+l+n+u+g +#E: Empty group +#>: Growing file p+ftype+l+u+g+i+n+S +#The following are available if you have mhash support enabled: +#gost: gost checksum +#whirlpool: whirlpool checksum +#The following are available and added to the default groups R, L and > +#only when explicitly enabled using configure: +#acl: access control list +#selinux SELinux security context +#xattrs: extended file attributes +#e2fsattrs: file attributes on a second extended file system + +# Rule definition +All=R+a+sha1+rmd160+sha256+sha512+tiger@aideextragroups@ + +# report_ignore_added_attrs, report_ignore_removed_attrs and +# report_ignore_changed_attrs are special rule definitions +# the addition, removal or change of the attributes listed are not displayed in +# the final report +#report_ignore_added_attrs = b +#report_ignore_removed_attrs = b +#report_ignore_changed_attrs = b + +# report_force_attrs is a special rule definition +# the attributes listed in it are always displayed for changed files in the +# final report. If an attribute is both ignored and forced the attribute is not +# considered for file change but printed in the final report if the file has +# been otherwise changed. +#report_force_attrs = u+g + +# Attributes that can be used to verify that aide in intact +# by people that have downloaded it from the web. +# Let's be paranoid +Norm=l+s+n+b+md5+sha1+rmd160+sha256+sha512+tiger@aideextragroups@ + +# The commented rules are just examples the rest are used by +# make check + +#Selection regexp rule +@@{TOPDIR}/.* Norm +#Equals selection only the directory doc is checked and not it's children +#=@@{TOPDIR}/doc L +#Negative selection no rule is necessary but ignored if there +!@@{TOPDIR}/.*~ +!@@{TOPDIR}/src/.*\.o +!@@{TOPDIR}/src/(aide|core)$ L +!@@{TOPDIR}/.*RCS +!@@{TOPDIR}/.*CVS +!@@{TOPDIR}/.*aide\.db.* +!@@{TOPDIR}/.*\.cvsignore.* +# @@{TOPDIR}/doc/.* All + diff --git a/doc/manual.html b/doc/manual.html new file mode 100644 index 0000000..5127038 --- /dev/null +++ b/doc/manual.html @@ -0,0 +1,694 @@ + + + +AIDE Manual version 0.16 + + + +

The AIDE manual

+

About this document

+

+This manual is by no means complete, usable, readable, comprehensible, +or error free. +

+

+If you have any corrections, additions or constructive comments, please +report them as bugs, patches or feature requests +here. +

+

+This document was originally written by Rami Lehti +<rammer@cs.tut.fi> +with additions made by Marc Haber +<mh+aide-manual@zugschlus.de> +, Richard van den Berg +<richard@vdberg.org> +and Hannes von Haugwitz +. +

+ +

Table of Contents

+
    +
  1. About this document
  2. +
  3. Table of Contents
  4. +
  5. What is AIDE?
  6. +
  7. Compiling AIDE
  8. +
  9. Configuration
  10. +
  11. Usage
  12. +
  13. Database and config signing
  14. +
  15. Miscellaneous
  16. +
  17. General guidelines for security
  18. +
+ + +

What is AIDE?

+

+AIDE (Advanced Intrusion Detection Environment) is an intrusion +detection program. More specifically a file integrity checker. +

+

+AIDE constructs a database of the files specified in aide.conf, AIDE's configuration file. +The AIDE database stores various file attributes including: +file type, permissions, inode number, user, group, file size, mtime and ctime, +atime, growing size, number of links and link name. +AIDE also creates a cryptographic checksum or hash of each file using +one or a combination of the following message digest algorithms: sha1, +sha256, sha512, md5, rmd160, tiger, haval, crc32 (gost and whirlpool can be +compiled in if mhash support is available). +Additionally, the attributes acl, xattr, selinux and e2fsattrs can be used when +explicitly enabled during compile time. +

+Typically, a system administrator will create an AIDE database on a +new system before it is brought onto the network. This first AIDE +database is a snapshot of the system in it's normal state and the +yardstick by which all subsequent updates and changes will be +measured. The database should contain information about key system +binaries, libraries, header files, all files +that are expected to remain the same over time. The database probably +should not contain information about files which change frequently +like log files, mail spools, proc filesystems, user's home +directories, or temporary directories. +

+After a break-in, an administrator may begin by examining the system +using system tools like ls, ps, netstat, and who --- + the very tools most likely to be trojaned. Imagine that ls has been +doctored to not show +any file named "sniffedpackets.log" and that ps and netstat have been +rewritten to not show any information for a process named +"sniffdaemond". +Even an administrator who had previously printed out on paper the +dates and sizes of these key system files can not be certain by +comparison that they have not been modified in some way. File dates +and sizes can be manipulated, some better root-kits make this trivial. +

+While it is possible to manipulate file dates and sizes, it is much +more difficult to manipulate a single cryptographic checksum like md5, +and exponentially more difficult to manipulate each of the entire +array of checksums that AIDE supports. By rerunning AIDE after a +break-in, a system administrator can quickly identify changes to key +files and have a fairly high degree of confidence as to the accuracy +of these findings. +

+

+Unfortunately, AIDE can not provide absolute sureness about change in +files. Like any other system file, AIDE's binary and/or database can +also be altered. +

+ + + +

Compiling AIDE

+

I'm in a hurry. Bottom line about compilation.

+

+After you have installed all the necessary software do +./configure;make;make install in the main AIDE +directory of the unpacked source tree. You should carefully think +about the configuration and what a possible hacker can do if +he/her/they/it has root access.

+ +

Getting all that is needed

+

+Before you can compile AIDE you must have certain things: +

+ +

Please check to see if there are mirrors available.

+

+Once you have the source code of AIDE you should unpack it. If you +have GNU tar then the command is tar zxvf +aide-<VERSION_NUMBER>.tar.gz +

+

Source Code Verification

+

+It is highly recommended to verify the signature of your +downloaded source code. You can either verify the source tarball or the git +tag. +

+

+To check the supplied signature with GnuPG: +

+
+
+$ gpg --verify aide-<VERSION_NUMBER>.tar.gz.asc
+
+
+

+To validate the gpg signature of the git tag: +

+
+
+$ git verify-tag v<VERSION_NUMBER>
+
+
+

The current public key is published on aide.sourceforge.net.

+

+If you do not have that key, you can get it from one of the well known PGP key +servers. +

+

+You have to make sure that the key you install is not a faked one. You +can do this with reasonable assurance by comparing the output of +

+
+
+$ gpg --fingerprint 0x<KEYID>
+
+
+

+with the fingerprint published elsewhere. +

+

Compile-time configuration

+

+Next you must use the configure script found in AIDE's source code +package to configure the compilation process.

+There are several options you can select to configure. You can find out +what options are available with ./configure --help +command. Most of the time you do not need to give any options. +You can just use configure without any parameters.

+ +If you want to change the directory where AIDE is installed you can +use --prefix option. For example ./configure --prefix=/usr + +

+

Compilation and installation

+

+The compilation is done by simply typing make. You can +now type make install to install the binary and the +manual pages. The binary however should be installed on read-only +media or in some other tamperproof place. Also the databases should +be kept somewhere where a possible intruder cannot change them.

+ + +

Configuration

+

+Next you have to create a configuration file. You can find +more documentation for this in aide.conf(5) manual page. +

+

+There are three types of lines in aide.conf: +

+
    +
  • configuration lines - used to set configuration parameters and define/undefine variables
  • +
  • (restricted) selection lines - indicate which files will be added to the database
  • +
  • macro lines - define or undefine variables within the config file
  • +
+

+Lines beginning with # are ignored as comments. +

+

+Here is an example configuration.

+ + +
+#AIDE conf
+
+   # Here are all the things we can check - these are the default rules
+   #
+   #p:      permissions
+   #ftype:  file type
+   #i:      inode
+   #n:      number of links
+   #l:      link name
+   #u:      user
+   #g:      group
+   #s:      size
+   #b:      block count
+   #m:      mtime
+   #a:      atime
+   #c:      ctime
+   #S:      check for growing size
+   #I:      ignore changed filename
+   #md5:    md5 checksum
+   #sha1:   sha1 checksum
+   #sha256: sha256 checksum
+   #sha512: sha512 checksum
+   #rmd160: rmd160 checksum
+   #tiger:  tiger checksum
+   #haval:  haval checksum
+   #crc32:  crc32 checksum
+   #R:      p+ftupe+i+l+n+u+g+s+m+c+md5
+   #L:      p+ftype+i+l+n+u+g
+   #E:      Empty group
+   #>:      Growing file p+ftype+l+u+g+i+n+S
+   #The following are available if you have mhash support enabled:
+   #gost:   gost checksum
+   #whirlpool: whirlpool checksum
+   #The following are available and added to the default groups R, L and >
+   #only when explicitly enabled using configure:
+   #acl:    access control list
+   #selinux SELinux security context
+   #xattrs:  extended file attributes
+   #e2fsattrs: file attributes on a second extended file system
+
+   # You can also create custom rules - my home made rule definition goes like this
+   #
+   MyRule = p+i+n+u+g+s+b+m+c+md5+sha1
+
+   # Next decide what directories/files you want in the database
+
+   /etc p+i+u+g     #check only permissions, inode, user and group for etc
+   /bin MyRule      # apply the custom rule to the files in bin
+   /sbin MyRule     # apply the same custom rule to the files in sbin
+   /var MyRule
+   !/var/log/.*     # ignore the log dir it changes too often
+   !/var/spool/.*   # ignore spool dirs as they change too often
+   !/var/adm/utmp$  # ignore the file /var/adm/utmp
+
+
+
+ + + +

Here we include files in /etc, /bin and /sbin. We also include +/var but ignore /var/log, /var/spool and a single file /var/adm/utmp. +

+It is generally a good idea to ignore directories that frequently +change, unless you want to read long reports. +It is good practice to exclude tmp directories, mail spools, log +directories, proc filesystems, user's home directories, web content +directories, anything that changes regularly. It is also good practice to +include all system binaries, libraries, include files, system source +files. It will also be a good idea to include directories you don't +often look in like /dev /usr/man/.*usr/. Of course you'll want to +include as many files as practical, but think about what you include. +

+

+One example: If +you have a block device whose owner is changing frequently, you can +configure aide to just +check the attributes that do not normally change (inode, number of +links, ctime). +

+

+Note that if you are referring to a single file you should add $ to +the end of the regexp. This matches to the name of the file exactly +and does not include any other files that might have the same +beginning. In the example, all filenames beginning with +/var/adm/utmp would be ignored if there were no dollar sign at the +end of the last line. An intruder could then create a +directory called /var/adm/utmp_root_kit and place all the files +he/she/they wanted there and they would be ignored by AIDE. +

+

Special group definitions

+

+There are several special group definitions to tweak what attributes are +printed in the report. First report_force_attrs lists those attributes +that are always printed from changed files. For example, if you say +

+
+report_force_attrs = u+g
+
+

+and the size of a file changes, it's user and group id will also be printed +in the report. Secondly, report_ignore_added_attrs, +report_ignore_removed_attrs and report_ignore_changed_attrs define which +attributes to ignore from the report. For example, if you define +

+
+report_ignore_changed_attrs = b
+
+

+and the size of a file changes, it's block count will not be printed in the +report, even if it did change as well. +

+

+If an attribute is both ignored and forced the attribute is not considered for +file change but printed in the final report if the file has been otherwise +changed. +

+

Troubleshooting your config

+

Making a config file is a lot of hard work and must be done on a case +by case bases. Don't give up simply because you don't get it right +the first time around. This section gives you a few hints on how to debug +your config. +

+

+You can use aide --verbose=255 to generate a lot of debug +output to help you see which files get added and which are discarded. +The following section gives some more information about +AIDE's rule matching algorithm. +

+

Understanding AIDE rule matching

+

+Before reading this you should have basic understanding of how regular +expressions in general and Perl Compatible Regular Expressions in particular +work. There are several good books about this. Several Perl-books also have +decent explanations about this subject. +

+

+As you already know, aide has three types of selection lines: +

+
    +
  • Regular selection lines, beginning with "/".
  • +
  • Equals selection lines, beginning with "=".
  • +
  • Negative selection lines, beginning with "!".
  • +
+

+The string following the first character is taken as a regular +expression matching to a complete filename, including the path. In a +regular selection rule, the slash is included in the regular +expression. An implicit ^ is added in front of each rule. A group +definition follows the regular expression. +

+

+When reading the configuration file, aide internally builds a tree +that roughly resembles the directory tree to be checked. Each node +corresponds to a directory, and each node has one rule list for the +associated regular selection lines, one for the associated negative +selection lines and one for the associated equals selection lines. If +there is no associated rule, the respective list may be empty. +

+

+aide tries to place a rule as far down in the tree as possible while +still assuring that it is above all files that it matches. This is +determined by the first "special" regexp character in the rule. For +example, !/proc would be placed in the root node, +!/proc/.* would be placed in the /proc node, +!/var/log/syslog* is placed in the /var/log node and, +finally, !/home/[a-z0-9]+/.bashrc$ is placed in the /home +node. +

+

+The algorithm that aide uses for rule matching is described in the +following paragraphs. The pseudocode is an adaption from src/gen_list.c. +

+
+
+check_node_for_match(node,filename,first_time)
+    if (first_time)
+            check(equals list for this node)
+
+    check(regular list for this node)
+
+    if (node is not the root node)
+        check_node_for_match(nodes parent,filename,false)
+
+    if (this file is about to be added)
+        check(negative list for this node)
+
+    return (info about whether this file should be added or not and how)
+
+
+

+When aide needs to determine whether a file found in the file system is +to be checked, it first determines the deepest possible node x to +match the current file against (that algorithm is not part of the +pseudocode above), and then calls check-node_for_match(x, filename, +true). So, the recursion starts at the deepest possible match. +

+

+As it can also be seen, equals selection lines are only checked in the +first recursion step, thus providing some kind of speed optimization +by reducing the number of necessary regular expression evaluations, +which is a quite expensive operation. +

+
Pitfalls
+

+There are some side-effects from this algorithm that might seem +strange at first. For example if you have the following rules: +

+
+
+/ R
+=/var/log/messages$ R+a
+!/var/log/messages.*
+
+
+

+This is what you might write if you want to check /var/log/messages +but not /var/log/messages.0 and /var/log/messages.1 etc. However since +the negative selection rules are checked last and .* can match to an +empty string /var/log/messages is not added to the database. The +following is a more correct way of doing it. +

+
+
+/ R
+=/var/log/messages$ R+a
+!/var/log/messages\.[0-9]$
+
+
+

+Now only messages files ending in number 0-9 are not included in the +database. Note an intruder could disguise a rootkit by creating a +directory called messages.9. If messages.9 does not already exist that +is. +

+

+Consider the following rules: +

+
+
+/ n+p+l+i+u+g+s+b+m+c+md5+sha1+rmd160+haval+gost+crc32+tiger
+/etc$ n+p+l+i+u+g
+/etc/resolv.conf$ n+p+l+u+g
+
+
+

+This way, changing /etc/resolv.conf will also report /etc as having +their mtime and ctime changed, even if /etc is configured not to be +checked for mtime and ctime. The reason is that aide only uses a +deepest-match algorithm to find the tree node to search, but a +first-match algorithm inside the node. Since /etc is in the / +directory, /etc will match the rule for the root directory and ignore +the specialized /etc rule. +

+

+Rearranging the configuration like this: +

+
+
+/etc/resolv.conf$ n+p+l+u+g
+/etc$ n+p+l+i+u+g
+/ n+p+l+i+u+g+s+b+m+c+md5+sha1+rmd160+haval+gost+crc32+tiger
+
+
+

+will solve the issue. It is generally a good idea to write the most +general rules last. +

+ +

Usage

+

+First you must create a database against which future checks are +performed. This should be done immediately after the operating system +and applications have been installed, before the machine is plugged +into a network. You can do this by giving the command +aide --init. +This creates a database that contains all of the files that you +selected in your config file. The newly created database should now be +moved to a secure location such as read-only media. You should also +place the configuration file and the AIDE binary and preferably the +manual pages and this manual on that media also. Please remember to +edit the configuration file so that the input database is read from +that read-only media. The config file should not be kept on the +target machine. The attacker could read the config file and alter it +and if he does alter it he could place his rootkit in a place that +AIDE does not check. So the read-only media should be accessible only +during the check.

+

+Now you are all set to go. You can now check the integrity of the +files. This can be done by giving the command +aide --check. +AIDE now reads the database and compares it to the files found on the +disk. AIDE may find changes in places that you might not expect. For +instance tty devices often change owners and permissions. You may want +to read long reports and that is up to you to decide. But most of us +do not have the time or the inclination read through tons of garbage +every day, so you should trim the config file to include only the +files and attributes of certain files that should not change. But keep +in mind that you should not ignore too much as that leaves you open +for an attack. An intruder might place his/her/its/their root kit in a +directory that you have ignored completely. One good example is +/var/spool/lp or something similar. This is the place that lp daemon +stores its temporary files. You should not ignore it completely +however. You should only ignore the format of files that you lp daemon +keeps creating. And remember to use the $-sign at the end of your +regexps. This stops someone from creating a directory that is ignored +along with its contents.

+

+Now that you have trimmed your config file you should update the +database. This can be done by: +aide --update +The update command also does the same thing as check but it +creates a new database. This database should now be placed on +that read-only media along with the new config file. The check, trim, +update cycle should be repeated as long as necessary. I recommend that +the config file should be reviewed once in a while. The definition of +"a while" depends on your paranoia. Some might want do it daily after +each check. Some might want to do it weekly.

+

+There is usually some drift in the databases. What I mean by drift is +that new files are created, config files of applications are edited, +tons of small changes pile up until the report becomes +unreadable. This can be avoided by updating the database once in a +while. I myself run the update every night. But, I don't replace the +input database nearly as often. The replacement of the input datbase +should always be a manual operation. This should not be automated. +

+

+There is also an alternative way of doing this. This method may be +preferable for people that have lots of machines that run aide. +You can run +aide --init +on all of the hosts and move the generated databases to a central host +where you compare different versions of the databases with +aide --compare +This has the benefit of freeing up resources on the monitored +machines. +

+ + +

Database and config signing

+

+The security of AIDE can be increased by signing the configuration and/or +database. When a database is signed, and it is changed manually, AIDE will +refuse to use it. Likewise, if a configuration is signed, AIDE will not use +it until the embedded hash is updated as well. +

+ +

+To make use of the signing features, use these options to the configure +script: +

+
+
+ --with-confighmactype=TYPE +
+
+ Hash type to use for checking config. Valid values + are md5 and sha1. +
+
+ --with-confighmackey=KEY +
+
+ HMAC hash key to use for checking config. Must be a + base64 encoded byte stream. Maximum string length is + 31 chars. +
+
+ --with-dbhmactype=TYPE +
+
+ Hash type to use for checking db. Valid values are + md5 and sha1. +
+
+ --with-dbhmackey=KEY +
+
+ HMAC hash key to use for checking db. Must be a base64 + encoded byte stream. Maximum string length is 31 + chars. +
+
+

+The base64 encoding was chosen so that the keys are not limited to printable +characters. You can use a local base64 tool +to convert the keys to the right format. Then run configure, for example: +

+ + +

+./configure --with-confighmactype=sha1 +-with-confighmackey="YWlkZSBhaWRlIGFpZGUgYWlkZQo=" --with-dbhmactype=sha1 +--with-dbhmackey="YWlkZSBhaWRlIGFpZGUgYWlkZQo=" +

+ +

+To make the presence of a valid signature mandatory, the following configure +options can be used: +

+ +
+
+ --enable-forced_dbmd +
+
+ Forces the file/pipe database's to have checksum. +
+
+ --enable-forced_configmd +
+
+ Forces the config to have checksum. Also disables + --config-check +
+
+ +

+It is also possible to edit the config.h file by hand, and +changing the values of the FORCEDBMD and +FORCECONFIGMD macros. +

+ +

+Creating the hash for the aide.db database is done by running aide +--init or aide --update. The hash for the aide.conf +configuration file can be obtained by running aide +--config-check: +

+ +
+$ aide --config-check
+Config checked. Use the following to patch your config file.
+0a1
+> @@begin_config 27GF0+oKj1CvP4tltuibhu8YGIU=
+13a15
+> @@end_config
+
+ +

+The @@begin_config and @@end_config can be added +to the aide.conf file manually, or the output of aide +--config-check can be directly piped into patch: +

+ +
+$ aide --config-check | patch
+can't find file to patch at input line 2
+Perhaps you should have used the -p or --strip option?
+The text leading up to this was:
+--------------------------
+|Config checked. Use the following to patch your config file.
+--------------------------
+File to patch: /etc/aide.conf
+patching file /etc/aide.conf
+
+ +

+Using forced_configmd will make AIDE refuse to use unsigned +configuration files. This also disables the --config-check +option. This only makes sense if you already have a signed configuration, or +if you have an AIDE executable on another machine that can create the signed +configurations for you. +

+ + +

Miscellaneous

+

+The AIDE database can be used to find the real names and places of +files that have been moved to lost+found directory by fsck. +

+ +

General guidelines for security

+
    +
  1. Do not assume anything
  2. +
  3. Trust no-one,nothing
  4. +
  5. Nothing is secure
  6. +
  7. Security is a trade-off with usability
  8. +
  9. Paranoia is your friend
  10. +
+ + + diff --git a/include/aide.h b/include/aide.h new file mode 100644 index 0000000..8e07195 --- /dev/null +++ b/include/aide.h @@ -0,0 +1,99 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2004-2006,2010,2011 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ +#ifndef _AIDE_H_INCLUDED +#define _AIDE_H_INCLUDED + +#include "config.h" +#include "types.h" +#include "db_config.h" +#include +#include +#if HAVE_INTTYPES_H +# include +#endif +#if HAVE_FCNTL_H +# include +#endif +#include "report.h" + +#ifndef TEMP_FAILURE_RETRY +/* Evaluate EXPRESSION, and repeat as long as it returns -1 with errno' + set to EINTR. */ + +# define TEMP_FAILURE_RETRY(expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) +#endif + +#if !defined HAVE_VSNPRINTF || !defined HAVE_C99_VSNPRINTF +#define vsnprintf rsync_vsnprintf +int vsnprintf(char *str, size_t count, const char *fmt, va_list args); +#endif + +#if !defined HAVE_SNPRINTF || !defined HAVE_C99_VSNPRINTF +#define snprintf rsync_snprintf +int snprintf(char *str,size_t count,const char *fmt,...); +#endif + +#ifndef O_NOATIME +#if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +#define O_NOATIME 01000000 +#else +#define O_NOATIME 0 +#endif +#endif + +#ifdef strtoimax +# define HAVE_STRTOIMAX +#endif + +#if defined HAVE_OFF64_TYPE && SIZEOF_OFF64_T == SIZEOF_LONG_LONG || !defined HAVE_OFF64_TYPE && SIZEOF_OFF_T == SIZEOF_LONG_LONG +# ifdef HAVE_STRTOLL +# define AIDE_STRTOLL_FUNC strtoll +# else +# ifdef HAVE_STRTOIMAX +# define AIDE_STRTOLL_FUNC strtoimax +# else +# define AIDE_STRTOLL_FUNC strtol +# endif +# endif +#else +# define AIDE_STRTOLL_FUNC strtol +#endif + +#ifndef __NetBSD__ +#ifndef _POSIX_C_SOURCE +/* For _POSIX_THREAD_SEMANTICS _REENTRANT */ +#define _POSIX_C_SOURCE 199506L +#endif /* _POSIX_C_SOURCE */ +#endif /* __NetBSD__ */ + + +#define ARGUMENT_SIZE 65536 + +/* This is a structure that has all configuration info */ +extern db_config* conf; + +#endif + diff --git a/include/base64.h b/include/base64.h new file mode 100644 index 0000000..0ff7116 --- /dev/null +++ b/include/base64.h @@ -0,0 +1,51 @@ +/* +** +** Copyright (C) 1994 Swedish University Network (SUNET) +** Modified by Rami Lehti (C) 1999 +** $Header$ +** +** +** 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 FITTNESS 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +** +** Martin.Wendel@udac.uu.se +** Torbjorn.Wictorin@udac.uu.se +** +** UDAC +** P.O. Box 174 +** S-751 04 Uppsala +** Sweden +** +*/ + +#ifndef _BASE64_H_INCLUDED +#define _BASE64_H_INCLUDED +#include +#include +#include "types.h" + +#define B64_BUF 16384 +#define FAIL -1 +#define SKIP -2 + + +char* encode_base64(byte* src,size_t ssize); + +byte* decode_base64(char* src,size_t ssize,size_t *); + +/* Returns decoded length */ +size_t length_base64(char* src,size_t ssize); + +#endif /* _BASE64_H_INCLUDED */ diff --git a/include/be.h b/include/be.h new file mode 100644 index 0000000..bacf29f --- /dev/null +++ b/include/be.h @@ -0,0 +1,27 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen + * $Header$ + * + * 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 + */ + +#ifndef _BE_H_INCLUDED +#define _BE_H_INCLUDED +#include "db_config.h" + +FILE* be_init(int inout,url_t* u,int iszipped); + +#endif /* _BE_H_INCLUDED */ diff --git a/include/commandconf.h b/include/commandconf.h new file mode 100644 index 0000000..956233a --- /dev/null +++ b/include/commandconf.h @@ -0,0 +1,100 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006,2011,2015,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _COMMANDCONF_H_INCLUDED +#define _COMMANDCONF_H_INCLUDED +#include "list.h" +#include "gen_list.h" +#include "db_config.h" + +extern long conf_lineno; +extern int newlinelastinconfig; + +int commandconf(const char mode,const char* line); + +int conf_input_wrapper(char* buf, int max_size, FILE* in); +int db_input_wrapper(char* buf, int max_size, int db); + +list* append_rxlist(char*,DB_ATTR_TYPE,list*, RESTRICTION_TYPE); + +void do_define(char*,char*); + +void do_undefine(char*); + +int do_ifxdef(int,char*); + +int do_ifxhost(int,char*); + +void do_groupdef(char*,DB_ATTR_TYPE); + +RESTRICTION_TYPE get_restrictionval(char*); + +DB_ATTR_TYPE get_groupval(char*); + +void putbackvariable(char*); + +int handle_endif(int doit,int allow_else); + +void do_dbdef(int, char*); + +void do_verbdef(char*); + +void do_replevdef(char*); + +void do_repurldef(char*); + +void do_rootprefix(char*); + +void do_report_ignore_e2fsattrs(char*); + +int check_db_order(DB_FIELD*,int, DB_FIELD); + +void* get_db_key(void); +void* get_conf_key(void); +size_t get_db_key_len(void); +size_t get_conf_key_len(void); + + + +extern const char* aide_key_1; +extern const char* aide_key_2; +extern const char* aide_key_3; +extern const char* aide_key_4; +extern const char* aide_key_5; +extern const char* aide_key_6; +extern const char* aide_key_7; +extern const char* aide_key_8; +extern const char* aide_key_9; +extern const char* aide_key_0; + +extern const char* db_key_1; +extern const char* db_key_2; +extern const char* db_key_3; +extern const char* db_key_4; +extern const char* db_key_5; +extern const char* db_key_6; +extern const char* db_key_7; +extern const char* db_key_8; +extern const char* db_key_9; +extern const char* db_key_0; + + +#endif diff --git a/include/compare_db.h b/include/compare_db.h new file mode 100644 index 0000000..77f5a8b --- /dev/null +++ b/include/compare_db.h @@ -0,0 +1,34 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006,2010 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _COMPARE_DB_H_INCLUDED +#define _COMPARE_DB_H_INCLUDED +#include "list.h" +#include "db_config.h" +#include "seltree.h" + +/* + * gen_report() + * Generate report based on the given node + */ +int gen_report(seltree* node); + +#endif diff --git a/include/conf_lex.h b/include/conf_lex.h new file mode 100644 index 0000000..6a06899 --- /dev/null +++ b/include/conf_lex.h @@ -0,0 +1,35 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006 Rami Lehti, Pablo Virolainen, Richard + * van den Berg + * $Header$ + * + * 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 + */ + +#ifndef _CONF_LEX_H_INCLUDED_ +#define _CONF_LEX_H_INCLUDED_ + +void conf_put_token(const char* s); + +extern int conferror(const char*); + +extern int conflex(void); + +extern int confparse(void); + +extern void* conf_scan_string(char*); + +#endif diff --git a/include/db.h b/include/db.h new file mode 100644 index 0000000..d8ea94d --- /dev/null +++ b/include/db.h @@ -0,0 +1,59 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2004,2005,2013,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _DB_H_INCLUDED +#define _DB_H_INCLUDED + +#include +#include "db_config.h" + +int db_init(int); + +db_line* db_readline(int); + +int db_writespec(db_config*); + +int db_writeline(db_line*,db_config*); + +void db_close(); + +void free_db_line(db_line* dl); + +extern const char* db_names[]; +extern const int db_value[]; + +#define DB_OLD (1<<0) +#define DB_WRITE (1<<1) +#define DB_NEW (1<<2) +#define NODE_ADDED (1<<4) +#define NODE_REMOVED (1<<5) +#define NODE_CHANGED (1<<6) +#define NODE_FREE (1<<7) +#define DB_DISK (1<<8) + +#define NODE_TRAVERSE (1<<9) +#define NODE_CHECKED (1<<10) +#define NODE_MOVED_OUT (1<<11) +#define NODE_MOVED_IN (1<<12) +#define NODE_ALLOW_NEW (1<<13) +#define NODE_ALLOW_RM (1<<14) + +#endif diff --git a/include/db_config.h b/include/db_config.h new file mode 100644 index 0000000..e92fe1c --- /dev/null +++ b/include/db_config.h @@ -0,0 +1,441 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2004-2006,2010-2013,2015,2016 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _DB_CONFIG_H_INCLUDED +#define _DB_CONFIG_H_INCLUDED +#include "aide.h" +#include "types.h" +#include +#include +#include + +#define E2O(n) (1< +typedef struct acl_type{ + int entries; + aclent_t* acl; +} acl_type; + +#endif + +#ifdef WITH_POSIX_ACL /* POSIX acl works for Sun ACL, AIUI but anyway... */ +#include +#ifndef WITH_ACL +# error "No ACL support ... but POSIX ACL support." +#endif +#endif + +typedef struct acl_type { + char *acl_a; /* ACCESS */ + char *acl_d; /* DEFAULT, directories only */ +} acl_type; + +#ifdef WITH_XATTR /* Do generic user Xattrs. */ +#include +#include +#endif + +typedef struct xattr_node +{ + char *key; + byte *val; + size_t vsz; +} xattr_node; + +typedef struct xattrs_type +{ + size_t num; + size_t sz; + struct xattr_node *ents; +} xattrs_type; + +#ifdef WITH_SELINUX +#include +#ifndef ENOATTR +# define ENOATTR ENODATA +#endif +#endif + +#ifdef WITH_E2FSATTRS +#include +#endif + +#ifdef WITH_MHASH +#include +#endif + +#ifdef WITH_ZLIB +#include +#endif + +#define RETOK 0 +#define RETFAIL -1 + +#define DO_INIT (1<<0) +#define DO_COMPARE (1<<1) +#define DO_DIFF (1<<2) + +#include "url.h" + +/* +typedef enum { + url_file, url_stdout, url_stdin, url_stderr, url_fd, url_http, + url_sql, url_syslog, url_database, url_multiplexer , url_unknown +} URL_TYPE; +*/ +/* + typedef struct url_t {*/ + /* Everything before the first ':' */ +/* + URL_TYPE type; + char* value; +} url_t; +*/ + +typedef enum { + db_filename=0, /* "name", */ + db_linkname, /* "lname", */ + db_perm, /* "perm", */ + db_uid, /* "uid", */ + db_gid, /* "gid", */ + db_size, /* "size", */ + db_atime, /* "atime", */ + db_ctime, /* "ctime", */ + db_mtime, /* "mtime", */ + db_inode, /* "inode", */ + db_bcount, /* "bcount", */ + db_lnkcount, /* "lcount", */ + db_md5, /* "md5", */ + db_sha1, /* "sha1", */ + db_rmd160, /* "rmd160", */ + db_tiger, /* "tiger", */ + db_crc32, /* "crc32", */ + db_haval, /* "haval", */ + db_gost, /* "gost", */ + db_crc32b, /* "crc32b", */ + db_attr, /* attributes */ + db_acl, /* access control list */ + db_bsize, /* "bsize" */ + db_rdev, /* "rdev" */ + db_dev, /* "dev" */ + db_checkmask, /* "checkmask"*/ + db_allownewfile, /* "allownewfile */ + db_allowrmfile, /* "allowrmfile" */ + db_sha256, /* "sha256", */ + db_sha512, /* "sha512", */ + db_whirlpool, /* "whirlpool", */ + db_selinux, /* "selinux", */ + db_xattrs, /* "xattrs", */ + db_e2fsattrs, /* "e2fsattrs" */ + db_unknown } DB_FIELD; /* "unknown" */ + +/* db_unknown must be last because it is used to determine size of + DB_FILED */ + +/* FIXME: THIS IS A HACK, sometimes we use AIDE_OFF_TYPE instead + * because that's what internal functions take. This bitmap needs to die. */ +#define DB_ATTR_TYPE unsigned long long +#define DB_ATTR_UNDEF ((DB_ATTR_TYPE) -1) + +/* WE need this for rx_rules since enums are not orrable (horrible) */ +#define DB_FILENAME (1LLU<<0) /* "name", */ +#define DB_LINKNAME (1LLU<<1) /* "lname", */ +#define DB_PERM (1LLU<<2) /* "perm", */ +#define DB_UID (1LLU<<3) /* "uid", */ +#define DB_GID (1LLU<<4) /* "gid", */ +#define DB_SIZE (1LLU<<5) /* "size", */ +#define DB_ATIME (1LLU<<6) /* "atime", */ +#define DB_CTIME (1LLU<<7) /* "ctime", */ +#define DB_MTIME (1LLU<<8) /* "mtime", */ +#define DB_INODE (1LLU<<9) /* "inode", */ +#define DB_BCOUNT (1LLU<<10) /* "bcount", */ +#define DB_LNKCOUNT (1LLU<<11) /* "lcount", */ +#define DB_MD5 (1LLU<<12) /* "md5", */ +#define DB_SHA1 (1LLU<<13) /* "sha1", */ +#define DB_RMD160 (1LLU<<14) /* "rmd160", */ +#define DB_TIGER (1LLU<<15) /* "tiger", */ +/* + We want to matk these newertheless we have a + hash-functon or not. + */ + +#define DB_CRC32 (1LLU<<16) /* "crc32", */ +#define DB_HAVAL (1LLU<<17) /* "haval", */ +#define DB_GOST (1LLU<<18) /* "gost", */ +#define DB_CRC32B (1LLU<<19) /* "crc32b", */ +// #define DB_ATTR (1LLU<<20) /* "attr" */ +#define DB_ACL (1LLU<<21) /* "acl" */ +#define DB_BSIZE (1LLU<<22) /* "bsize" */ +#define DB_RDEV (1LLU<<23) /* "rdev" */ +#define DB_DEV (1LLU<<24) /* "dev" */ + +#define DB_CHECKMASK (1LLU<<25) /* "checkmask"*/ +#define DB_SIZEG (1LLU<<26) /* "unknown" */ +#define DB_CHECKINODE (1LLU<<27) /* "checkinode"*/ +#define DB_NEWFILE (1LLU<<28) /* "allow new file" */ +#define DB_RMFILE (1LLU<<29) /* "allot rm file" */ +#define DB_SHA256 (1LLU<<30) /* "sha256", */ +#define DB_SHA512 (1LLU<<31) /* "sha512", */ +#define DB_SELINUX (1LLU<<32) /* "selinux", */ +#define DB_XATTRS (1LLU<<33) /* "xattrs", */ +#define DB_WHIRLPOOL (1LLU<<34) /* "whirlpool", */ +#define DB_FTYPE (1LLU<<35) /* "file type", */ +#define DB_E2FSATTRS (1LLU<<36) /* "ext2 file system attributes" */ + +#define DB_HASHES (DB_MD5|DB_SHA1|DB_RMD160|DB_TIGER|DB_CRC32|DB_HAVAL| \ + DB_GOST|DB_CRC32B|DB_SHA256|DB_SHA512|DB_WHIRLPOOL) + +extern const char* db_names[db_unknown+1]; +extern const int db_value[db_unknown+1]; + +/* db_namealias && db_aliasvalue are here to support earlier database + * names that are no longer used. */ +#define db_alias_size 1 +extern const char* db_namealias[db_alias_size]; +extern const int db_aliasvalue[db_alias_size]; + +/* TIMEBUFSIZE should be exactly ceil(sizeof(time_t)*8*ln(2)/ln(10)) + * Now it is ceil(sizeof(time_t)*2.5) + * And of course we add one for end of string char + */ + +#define TIMEBUFSIZE (((sizeof(time_t)*5+1)>>1)+1) + + +/* + New db_config + Not used yet, maybe someday. +*/ + +/* typedef struct _db_config { */ +/* url_t* url; */ +/* config* conf; */ +/* int inout; */ +/* int (*init)(url*,int,config*); */ +/* char** (*readline)(_db_config*); */ +/* int (*writeline)(_db_config*,db_line* line); */ +/* int (*close)(_db_config*); */ +/* int db_size; */ +/* DB_FIELD* db_order; */ +/* void* local; */ +/* }_db_config ; */ + + +#include "seltree.h" + +typedef struct db_line { + byte* md5; + byte* sha1; + byte* rmd160; + byte* tiger; + + byte* sha256; + byte* sha512; + + byte* crc32; /* MHASH only */ + byte* haval; + byte* gost; + byte* crc32b; + byte* whirlpool; + + acl_type* acl; + /* Something here.. */ + + mode_t perm; + mode_t perm_o; /* Permission for tree traverse */ + uid_t uid; + gid_t gid; + time_t atime; + time_t ctime; + time_t mtime; + AIDE_INO_TYPE inode; + nlink_t nlink; + + AIDE_OFF_TYPE size; + AIDE_OFF_TYPE size_o; /* ... */ + AIDE_BLKCNT_TYPE bcount; + char* filename; + char* fullpath; + char* linkname; + + char *cntx; + + xattrs_type* xattrs; + + unsigned long e2fsattrs; + + /* Attributes .... */ + DB_ATTR_TYPE attr; + +} db_line; + +typedef struct db_config { + + url_t* db_in_url; + FILE* db_in; + + url_t* db_new_url; + FILE* db_new; + + url_t* db_out_url; + FILE* db_out; + + int config_check; + + struct md_container *mdc_in; + struct md_container *mdc_out; + + struct db_line *line_db_in; + struct db_line *line_db_out; + + DB_ATTR_TYPE db_attrs; + +#ifdef WITH_ZLIB + gzFile db_gzin; + gzFile db_gznew; + gzFile db_gzout; + /* Is dbout gzipped or not */ + int gzip_dbout; + +#endif + + int db_in_size; + DB_FIELD* db_in_order; + + int db_new_size; + DB_FIELD* db_new_order; + + int db_out_size; + DB_FIELD* db_out_order; + + char* config_file; + char* config_version; + + + int do_dbnewmd; + int do_dboldmd; +#ifdef WITH_MHASH + int do_configmd; + MHASH confmd; + hashid confhmactype; + char* old_confmdstr; + + hashid dbhmactype; + MHASH dbnewmd; + MHASH dboldmd; +#endif + char* old_dbnewmdstr; + char* old_dboldmdstr; + + + /* The following three a lists of rx_rule*s */ + list* selrxlst; + list* equrxlst; + list* negrxlst; + + int verbose_level; + int database_add_metadata; + int report_detailed_init; + int report_base16; + int report_quiet; + int use_initial_errorsto; + +#ifdef WITH_E2FSATTRS + unsigned long report_ignore_e2fsattrs; +#endif + + url_t* initial_report_url; + FILE* initial_report_fd; + + /* report_url is a list of url_t*s */ + list* report_url; + + /* report_fd is a list of FILE*s */ + list* report_fd; + + /* Report syslog */ + + int report_syslog; + int report_db; + + /* defsyms is a list of symba*s */ + list* defsyms; + /* so is groupsyms */ + list* groupsyms; + + /* What are we supposed to do */ + int action; + + /* Should we catch errors from mmapping */ + int catch_mmap; + + time_t start_time; + time_t end_time; + + int symlinks_found; + DB_ATTR_TYPE attr; + +#ifdef WITH_ACL + int no_acl_on_symlinks; +#endif + int warn_dead_symlinks; + + int grouped; + + int summarize_changes; + + char* root_prefix; + int root_prefix_length; + + char* limit; + pcre* limit_crx; + + struct seltree* tree; + +} db_config; + +#ifdef WITH_PSQL +#include "libpq-fe.h" + +typedef struct psql_data{ + PGconn* conn; + char* table; + PGresult *res; + int des[db_unknown]; + int curread; + int maxread; +} psql_data; + +#endif + +#endif diff --git a/include/db_disk.h b/include/db_disk.h new file mode 100644 index 0000000..e89facd --- /dev/null +++ b/include/db_disk.h @@ -0,0 +1,30 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2011 Rami Lehti, Pablo Virolainen, Hannes von + * Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _DB_DISK_H_INCLUDED +#define _DB_DISK_H_INCLUDED + +#include "db.h" + +db_line* db_readline_disk(); +int db_disk_init(void); + +#endif diff --git a/include/db_file.h b/include/db_file.h new file mode 100644 index 0000000..915bda8 --- /dev/null +++ b/include/db_file.h @@ -0,0 +1,43 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006 Rami Lehti, Pablo Virolainen, Richard + * van den Berg + * $Header$ + * + * 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 + */ + +#ifndef _DB_FILE_H_INCLUDED +#define _DB_FILE_H_INCLUDED + +#include "db.h" + +extern void db_buff(int, FILE*); +extern int db_scan(void); /* Rumaa.... */ +extern char* dbtext; /* Todella rumaa... */ +extern long* db_lineno; +extern long db_in_lineno; +extern long db_new_lineno; + + +char** db_readline_file(int); +int db_writespec_file(db_config*); +int db_writeline_file(db_line* line,db_config* conf,url_t* url); +int db_close_file(db_config* conf); +#ifdef WITH_ZLIB +void handle_gzipped_input(int out,gzFile*); +#endif + +#endif diff --git a/include/db_list.h b/include/db_list.h new file mode 100644 index 0000000..58aabce --- /dev/null +++ b/include/db_list.h @@ -0,0 +1,41 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2010 Rami Lehti,Pablo Virolainen, Richard van + * den Berg + * $Header$ + * + * 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 + */ + +#ifndef _DB_LIST_H_INCLUDED +#define _DB_LIST_H_INCLUDED + +#include /* for NULL */ + +typedef struct db_list{ + struct db_list* next; + struct db_list* prev; + struct db_list* head; + struct db_list* tail; +} db_list; + +/* Only the head knows for sure where the tail is */ +static db_list* db_list_head=NULL; + +void db_list_append(db_list*item); + +#endif /* _DB_LIST_H_INCLUDED */ + + diff --git a/include/db_sql.h b/include/db_sql.h new file mode 100644 index 0000000..0851aac --- /dev/null +++ b/include/db_sql.h @@ -0,0 +1,58 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2004,2006,2010 Rami Lehti, Pablo Virolainen, + * Richard van den Berg + * $Header$ + * + * 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 + */ + +#ifndef _DB_SQL_H_INCLUDED +#define _DB_SQL_H_INCLUDED + + +static const char* db_sql_types[] = { + "text unique primary key",/* "name", */ + "text", /* "lname", */ + "int", /* "perm", */ + "int", /* "uid", */ + "int", /* "gid", */ + "bigint", /* "size", */ + "text", /* "atime", */ + "text", /* "ctime", */ + "text", /* "mtime", */ + "int", /* "inode", */ + "int", /* "bcount", */ + "int", /* "lcount", */ + "text", /* "md5", */ + "text", /* "sha1", */ + "text", /* "rmd160", */ + "text", /* "tiger", */ + "text", /* "crc32", */ + "text", /* "haval", */ + "text", /* "gost", */ + "text", /* "crc32b", */ + "int", /* "attr", */ + "text", /* "acl", */ + "int", /* "checkmask", */ + "text" /* "unknown" */ +}; + +int db_close_sql(void*); +db_line* db_readline_sql(int db, db_config* conf); +int db_writeline_sql(db_line* line,db_config* conf); +int db_writespec_sql(db_config* conf); + +#endif diff --git a/include/do_md.h b/include/do_md.h new file mode 100644 index 0000000..9b4caf8 --- /dev/null +++ b/include/do_md.h @@ -0,0 +1,51 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006,2010,2011 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * + * $Header$ + * 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 + */ + +#ifndef _DO_MD_H_INCLUDED +#define _DO_MD_H_INCLUDED +#ifdef WITH_MHASH +#include "mhash.h" +#endif + +#include "list.h" +#include "db_config.h" + +#define BUFSIZE 16384 + +list* do_md(list* file_lst,db_config* conf); + +#ifdef WITH_ACL +void acl2line(db_line* line); +#endif + +#ifdef WITH_XATTR +void xattrs2line(db_line *line); +#endif + +#ifdef WITH_SELINUX +void selinux2line(db_line *line); +#endif + +#ifdef WITH_E2FSATTRS +void e2fsattrs2line(db_line* line); +#endif + +#endif /* _DO_MD_H_INCLUDED */ diff --git a/include/fopen.h b/include/fopen.h new file mode 100644 index 0000000..5682d09 --- /dev/null +++ b/include/fopen.h @@ -0,0 +1,46 @@ +/* see src/fopen.c for copyright information */ + +#ifndef _FOPEN_H_INCLUDED +#define _FOPEN_H_INCLUDED + +#include +#include +#ifndef WIN32 +# include +#endif +#include +#include + +#include + +enum fcurl_type_e { + CFTYPE_NONE=0, + CFTYPE_FILE=1, + CFTYPE_CURL=2 +}; + +struct fcurl_data +{ + enum fcurl_type_e type; /* type of handle */ + union { + CURL *curl; + FILE *file; + } handle; /* handle */ + + char *buffer; /* buffer to store cached data*/ + size_t buffer_len; /* currently allocated buffers length */ + size_t buffer_pos; /* end of data in buffer*/ + int still_running; /* Is background url fetch still in progress */ +}; + +typedef struct fcurl_data URL_FILE; + +/* exported functions */ +URL_FILE *url_fopen(const char *url,const char *operation); +int url_fclose(URL_FILE *file); +int url_feof(URL_FILE *file); +size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file); +char * url_fgets(char *ptr, size_t size, URL_FILE *file); +void url_rewind(URL_FILE *file); + +#endif /* _FOPEN_H_INCLUDED */ diff --git a/include/gen_list.h b/include/gen_list.h new file mode 100644 index 0000000..c4d9c10 --- /dev/null +++ b/include/gen_list.h @@ -0,0 +1,79 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006,2010,2016 Rami Lehti,Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _GEN_LIST_H_INCLUDED +#define _GEN_LIST_H_INCLUDED +#include +#include "seltree.h" +#include "list.h" + +#define RESTRICTION_TYPE unsigned int +#define RESTRICTION_FT_REG (1U<<0) /* file */ +#define RESTRICTION_FT_DIR (1U<<1) /* dir */ +#define RESTRICTION_FT_FIFO (1U<<2) /* fifo */ +#define RESTRICTION_FT_LNK (1U<<3) /* link */ +#define RESTRICTION_FT_BLK (1U<<4) /* block device */ +#define RESTRICTION_FT_CHR (1U<<5) /* char device */ +#define RESTRICTION_FT_SOCK (1U<<6) /* socket */ +#define RESTRICTION_FT_DOOR (1U<<7) /* door */ +#define RESTRICTION_FT_PORT (1U<<8) /* port */ +#define RESTRICTION_NULL 0U + +/* DB_FOO are anded together to form rx_rule's attr */ + +typedef struct rx_rule { + char* rx; /* Regular expression in text form */ + pcre* crx; /* Compiled regexp */ + DB_ATTR_TYPE attr; /* Which attributes to save */ + long conf_lineno; /* line no. of rule definition*/ + RESTRICTION_TYPE restriction; +} rx_rule; + +int compare_node_by_path(const void *n1, const void *n2); + +/* + * gen_tree() + * Generates the file tree + * from rx_rule's + */ +seltree* gen_tree(list* prxlist,list* nrxlist,list* erxlist); + +/* + * populate_tree() + * Populate tree with data from disk and db + * Also do comparing while adding to the tree + */ +void populate_tree(seltree* tree); + +/* + * strrxtok() + * return a pointer to a copy of the non-regexp path part of the argument + */ + +char* strrxtok(char*); + +int check_rxtree(char* filename,seltree* tree, DB_ATTR_TYPE* attr, mode_t perm); + +db_line* get_file_attrs(char* filename,DB_ATTR_TYPE attr, struct AIDE_STAT_TYPE *fs); + +seltree* get_seltree_node(seltree* tree,char* path); + +#endif /*_GEN_LIST_H_INCLUDED*/ diff --git a/include/getopt.h b/include/getopt.h new file mode 100644 index 0000000..18982a0 --- /dev/null +++ b/include/getopt.h @@ -0,0 +1,169 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. + This file was part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/include/list.h b/include/list.h new file mode 100644 index 0000000..b7b149d --- /dev/null +++ b/include/list.h @@ -0,0 +1,60 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2010 Rami Lehti,Pablo Virolainen, Hannes von + * Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _LIST_H_INCLUDED +#define _LIST_H_INCLUDED + +typedef struct list { + struct list* next; + struct list* prev; + + struct list_header* header; + + /* + struct list* head; + struct list* tail; + */ + + void* data; +} list; + +typedef struct list_header{ + + struct list* head; + struct list* tail; + +}list_header; + +list* list_sorted_insert(list* listp, void* data, int (*compare) (const void*, const void*)); + +list* list_append(list* listp,void*data); + +/* + +list* new_list_item(void*); + +*/ + +list* list_delete_item(list* item); + +#endif /* _DB_LIST_H_INCLUDED */ + + diff --git a/include/locale-aide.h b/include/locale-aide.h new file mode 100644 index 0000000..9a548a1 --- /dev/null +++ b/include/locale-aide.h @@ -0,0 +1,36 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 2000,2001,2002 Rami Lehti, Pablo Virolainen + * $Header$ + * + * 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 + */ + +#ifndef _LOCALE_AIDE_H_INCLUDED +#define _LOCALE_AIDE_H_INCLUDED + +#ifdef USE_LOCALE + +#include +#include +#define _(Text) gettext(Text) + +#else + +#define _(Text) Text + +#endif /* USE_LOCALE */ + +#endif /* _LOCALE_AIDE_H_INCLUDED*/ diff --git a/include/md.h b/include/md.h new file mode 100644 index 0000000..84679ad --- /dev/null +++ b/include/md.h @@ -0,0 +1,154 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 2000-2002,2005,2006 Rami Lehti,Pablo Virolainen, + * Richard van den Berg + * $Header$ + * + * 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 + */ + + +#ifndef _MD_H_INCLUDED +#define _MD_H_INCLUDED + +#include "aide.h" + +/* + This should come from configure-script. + */ + +#include "db_config.h" + +#ifdef WITH_MHASH +#include + +#ifdef HAVE_MHASH_WHIRLPOOL +# define HASH_MHASH_COUNT MHASH_WHIRLPOOL /* WHIRLPOOL == 22 on 2006-10-11 */ +#else +# define HASH_MHASH_COUNT MHASH_RIPEMD320 +#endif +#define MHASH_RMD160 MHASH_RIPEMD160 +#define MHASH_HAVAL MHASH_HAVAL256 +#endif + +#ifdef WITH_GCRYPT +#include +#define HASH_GCRYPT_COUNT GCRY_MD_CRC32 +#ifndef WITH_MHASH +#define HASH_USE_GCRYPT (DB_MD5|DB_SHA1|DB_RMD160|DB_TIGER|DB_CRC32|\ + DB_HAVAL|DB_CRC32|DB_SHA256|DB_SHA512) +#endif +#endif + +/* + Lengths. Hope I got there right :) + */ + +#define HASH_MD5_LEN 16 +#define HASH_SHA1_LEN 20 +#define HASH_RMD160_LEN 20 +#define HASH_TIGER_LEN 24 +#define HASH_GOST_LEN 32 +#define HASH_HAVAL224_LEN 28 +#define HASH_HAVAL192_LEN 24 +#define HASH_HAVAL160_LEN 20 +#define HASH_HAVAL128_LEN 16 +#define HASH_HAVAL256_LEN 32 +#define HASH_TIGER128_LEN 16 +#define HASH_TIGER160_LEN 20 +#define HASH_MD4_LEN 16 +#define HASH_SHA256_LEN 32 +#define HASH_SHA512_LEN 64 +#define HASH_WHIRLPOOL_LEN 64 +#define HASH_ADLER32_LEN 4 +#define HASH_CRC32B_LEN 4 +#define HASH_CRC32_LEN 4 + + +/* + What we use from what library? + */ + +#ifdef WITH_MHASH +#define HASH_USE_MHASH (DB_MD5|DB_SHA1|DB_RMD160|DB_TIGER|DB_CRC32|\ + DB_HAVAL|DB_GOST|DB_CRC32|\ + DB_SHA256|DB_SHA512|DB_WHIRLPOOL) + +#define HASH_USE_GCRYPT (0) +#endif + + +/* + This struct hold's internal data needed for md-calls. + + */ + +typedef struct md_container { + /* + final hashes. There might be more these than AIDE currently supports, + but that should be an easy task. + */ + char crc32[HASH_CRC32_LEN]; + char md5[HASH_MD5_LEN]; + char sha1[HASH_SHA1_LEN]; + char haval[HASH_HAVAL256_LEN]; + char rmd160[HASH_RMD160_LEN]; + char tiger[HASH_TIGER_LEN]; + char gost[HASH_GOST_LEN]; + char crc32b[HASH_CRC32B_LEN]; + char haval224[HASH_HAVAL224_LEN]; + char haval192[HASH_HAVAL192_LEN]; + char haval160[HASH_HAVAL160_LEN]; + char haval128[HASH_HAVAL128_LEN]; + char tiger128[HASH_TIGER128_LEN]; + char tiger160[HASH_TIGER160_LEN]; + char md4[HASH_MD4_LEN]; + char sha256[HASH_SHA256_LEN]; + char sha512[HASH_SHA512_LEN]; + char adler32[HASH_ADLER32_LEN]; + char whirlpool[HASH_WHIRLPOOL_LEN]; + + + /* + Attr which are to be calculated. + */ + DB_ATTR_TYPE calc_attr; + /* + Attr which are not (yet) to be calculated. + After init hold's hashes which are not calculated :) + */ + DB_ATTR_TYPE todo_attr; + + /* + Variables needed to cope with the library. + */ +#ifdef WITH_MHASH + MHASH mhash_mdh[HASH_MHASH_COUNT+1]; +#endif + +#ifdef WITH_GCRYPT + gcry_md_hd_t mdh; +#endif + + +} md_container; + +int init_md(struct md_container*); +int update_md(struct md_container*,void*,ssize_t); +int close_md(struct md_container*); +void md2line(struct md_container*,struct db_line*); + + +#endif /*_MD_H_INCLUDED*/ diff --git a/include/report.h b/include/report.h new file mode 100644 index 0000000..f9bc008 --- /dev/null +++ b/include/report.h @@ -0,0 +1,53 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2010 Rami Lehti, Pablo Virolainen, Richard + * van den Berg + * $Header$ + * + * 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 + */ + +#ifndef _ERROR_H_INCLUDED +#define _ERROR_H_INCLUDED + +#include +#include +#include "db_config.h" +#include "url.h" + +/* Exitcodes */ +#define ERROR_WRITING_ERROR 14 +#define INVALID_ARGUMENT_ERROR 15 +#define UNIMPLEMENTED_FUNCTION_ERROR 16 +#define INVALID_CONFIGURELINE_ERROR 17 +#define IO_ERROR 18 +#define VERSION_MISMATCH_ERROR 19 + +/* Errorcodes */ +#define HASH_ALGO_ERROR 30 + +void error(int errorlevel, char* error_msg,...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))); +#else + ; +#endif + +int error_init(url_t*,int); + +void write_error_stderr(int errorlevel, char*error_msg,va_list ap); + + +#endif diff --git a/include/seltree.h b/include/seltree.h new file mode 100644 index 0000000..1483d3a --- /dev/null +++ b/include/seltree.h @@ -0,0 +1,64 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2010 Rami Lehti,Pablo Virolainen, Hannes von + * Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _SELTREE_H_INCLUDED +#define _SELTREE_H_INCLUDED +struct seltree; +#include "db_config.h" +#include "list.h" + + +/* seltree structure + * lists have regex_t* in them + * checked is whether or not the node has been checked yet and status + * when added + * path is the path of the node + * parent is the parent, NULL if root + * childs is list of seltree*:s + * new_data is this nodes new attributes (read from disk or db in --compare) + * old_data is this nodes old attributes (read from db) + * attr attributes to add for this node and possibly for its children + * changed_attrs changed attributes between new_data and old_data + */ + +typedef struct seltree { + list* sel_rx_lst; + list* neg_rx_lst; + list* equ_rx_lst; + list* childs; + struct seltree* parent; + + char* path; + int checked; + + long conf_lineno; + char* rx; + + DB_ATTR_TYPE attr; + + struct db_line* new_data; + struct db_line* old_data; + + DB_ATTR_TYPE changed_attrs; + +} seltree; + +#endif /* _SELTREE_H_INCLUDED*/ diff --git a/include/symboltable.h b/include/symboltable.h new file mode 100644 index 0000000..9a77877 --- /dev/null +++ b/include/symboltable.h @@ -0,0 +1,38 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006 Rami Lehti,Pablo Virolainen, Richard van + * den Berg + * $Header$ + * + * 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 + */ + +#ifndef _SYMBOLTABLE_H_INCLUDED +#define _SYMBOLTABLE_H_INCLUDED + +#include "list.h" + +typedef struct symba { + char* name; + char* value; + DB_ATTR_TYPE ival; + +} symba; + + +list* list_find(char* s,list* item); + +#endif + diff --git a/include/types.h b/include/types.h new file mode 100644 index 0000000..097abd1 --- /dev/null +++ b/include/types.h @@ -0,0 +1,117 @@ +/* types.h - some common typedefs + * Copyright (C) 1998 Free Software Foundation, Inc. + * + * This file was part of GNUPG. + * $Header$ + * + * GNUPG 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. + * + * GNUPG 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 + */ + +#ifndef _TYPES_H_INCLUDED +#define _TYPES_H_INCLUDED + +/* The AC_CHECK_SIZEOF() in configure fails for some machines. + * we provide some fallback values here */ +#if !SIZEOF_UNSIGNED_SHORT +# undef SIZEOF_UNSIGNED_SHORT +# define SIZEOF_UNSIGNED_SHORT 2 +#endif +#if !SIZEOF_UNSIGNED_INT +# undef SIZEOF_UNSIGNED_INT +# define SIZEOF_UNSIGNED_INT 4 +#endif +#if !SIZEOF_UNSIGNED_LONG +# undef SIZEOF_UNSIGNED_LONG +# define SIZEOF_UNSIGNED_LONG 4 +#endif + +#include + +#ifndef HAVE_BYTE +# undef byte /* maybe there is a macro with this name */ + typedef unsigned char byte; +# define HAVE_BYTE +#endif + +#ifndef HAVE_USHORT +# undef ushort /* maybe there is a macro with this name */ + typedef unsigned short ushort; +# define HAVE_USHORT +#endif + +#ifndef HAVE_ULONG +# undef ulong /* maybe there is a macro with this name */ + typedef unsigned long ulong; +# define HAVE_ULONG +#endif + +#ifndef HAVE_U16 +# undef u16 /* maybe there is a macro with this name */ +# if SIZEOF_UNSIGNED_INT == 2 + typedef unsigned int u16; +# elif SIZEOF_UNSIGNED_SHORT == 2 + typedef unsigned short u16; +# else +# error no typedef for u16 +# endif +# define HAVE_U16 +#endif + +#ifndef HAVE_U32 +# undef u32 /* maybe there is a macro with this name */ +# if SIZEOF_UNSIGNED_INT == 4 + typedef unsigned int u32; +# elif SIZEOF_UNSIGNED_LONG == 4 + typedef unsigned long u32; +# else +# error no typedef for u32 +# endif +# define HAVE_U32 +#endif + +#ifndef HAVE_U64 +# undef u64 /* maybe there is a macro with this name */ +# if SIZEOF_UNSIGNED_INT == 8 + typedef unsigned int u64; +# define HAVE_U64 +# elif SIZEOF_UNSIGNED_LONG == 8 + typedef unsigned long u64; +# define HAVE_U64 +# elif __GNUC__ >= 2 || defined(__SUNPRO_C) || defined(_AIX) && defined(_LONGLONG) + typedef unsigned long long u64; +# define HAVE_U64 +# endif +#endif + +typedef union { + int a; + short b; + char c[1]; + long d; +# ifdef HAVE_U64 + u64 e; +# endif + float f; + double g; +} PROPERLY_ALIGNED_TYPE; + +typedef struct string_list { + struct string_list *next; + unsigned int flags; + char d[1]; +} *STRLIST; + + +#endif /*_INCLUDED_TYPES_H*/ diff --git a/include/url.h b/include/url.h new file mode 100644 index 0000000..be9a866 --- /dev/null +++ b/include/url.h @@ -0,0 +1,42 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 2002,2006 Rami Lehti, Pablo Virolainen, Richard van den + * Berg + * $Header$ + * + * 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 + */ + +#ifndef _URL_H_INCLUDED +#define _URL_H_INCLUDED + +typedef enum { + url_file, url_stdout, url_stdin, url_stderr, url_fd, url_http, + url_sql, url_syslog, url_database, url_multiwriter, + url_gzip, url_string, url_ftp, url_https, + url_unknown +} URL_TYPE; + + +typedef struct url_t { + /* Everything before the first ':' */ + URL_TYPE type; + char* value; + void* data; /* We might want to pass some list's to multiwriter */ +} url_t; + + + +#endif diff --git a/include/util.h b/include/util.h new file mode 100644 index 0000000..7998853 --- /dev/null +++ b/include/util.h @@ -0,0 +1,69 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2006,2013 Rami Lehti, Pablo Virolainen, Richard + * van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + +#ifndef _UTIL_H_INCLUDED +#define _UTIL_H_INCLUDED +#include +#include +#include "db_config.h" + +#define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) + +#define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ? \ + ((x) - '0') : (toupper(x) - 'A' + 10)) + +#define ISXDIGIT(x) isxdigit ((unsigned char)(x)) + +#define CLEANDUP(x) (contains_unsafe (x) ? encode_string (x) : strdup (x)) + +#ifndef HAVE_STRICMP +# define stricmp(a,b) strcasecmp( (a), (b) ) +#endif + +int cmpurl(url_t*, url_t*); + +url_t* parse_url(char*); + +int contains_unsafe(const char*); + +void decode_string(char*); + +char* encode_string(const char*); + +char* perm_to_char(mode_t perm); + +void sig_handler(int signal); + +void init_sighandler(void); + +char *expand_tilde(char * path); + +#ifndef HAVE_STRNSTR +char* strnstr(char* haystack,char* needle,int n); +#endif + +#ifndef HAVE_STRNLEN +size_t strnlen(const char *s, size_t maxlen); +#endif + +int syslog_facility_lookup(char *); + +#endif diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..59990a1 --- /dev/null +++ b/install-sh @@ -0,0 +1,508 @@ +#!/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: diff --git a/missing b/missing new file mode 100755 index 0000000..f62bbae --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /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: diff --git a/src/aide.c b/src/aide.c new file mode 100644 index 0000000..f85c1b4 --- /dev/null +++ b/src/aide.c @@ -0,0 +1,654 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2006,2010-2013,2015,2016 Rami Lehti, Pablo Virolainen, + * Mike Markley, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAVE_UNISTD_H +#include +#endif + +#include "md.h" +#include "commandconf.h" +#include "compare_db.h" +#include "db_config.h" +#include "db_file.h" +#include "do_md.h" +#include "report.h" +#include "gen_list.h" +#include "getopt.h" +#include "list.h" +#include "util.h" +#include "base64.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ +db_config* conf; + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 256 +#endif + +static void usage(int exitvalue) +{ + fprintf(stderr, + _("Aide " AIDEVERSION" \n\n" + "Usage: aide [options] command\n\n" + "Commands:\n" + " -i, --init\t\tInitialize the database\n" + " -C, --check\t\tCheck the database\n" + " -u, --update\t\tCheck and update the database non-interactively\n" + " -E, --compare\t\tCompare two databases\n\n" + "Miscellaneous:\n" + " -D, --config-check\tTest the configuration file\n" + " -v, --version\t\tShow version of AIDE and compilation options\n" + " -h, --help\t\tShow this help message\n\n" + "Options:\n" + " -c [cfgfile]\t--config=[cfgfile]\tGet config options from [cfgfile]\n" + " -l [REGEX]\t--limit=[REGEX]\t\tLimit command to entries matching [REGEX]\n" + " -B \"OPTION\"\t--before=\"OPTION\"\tBefore configuration file is read define OPTION\n" + " -A \"OPTION\"\t--after=\"OPTION\"\tAfter configuration file is read define OPTION\n" + " -r [reporter]\t--report=[reporter]\tWrite report output to [reporter] url\n" + " -V[level]\t--verbose=[level]\tSet debug message level to [level]\n" + "\n") + ); + + exit(exitvalue); +} + +static void print_version(void) +{ + fprintf(stderr, + "Aide " AIDEVERSION "\n\n" + "Compiled with the following options:\n\n" AIDECOMPILEOPTIONS "\n"); + exit(0); +} + +static int read_param(int argc,char**argv) +{ + int option = -1; + char* err=NULL; + int i=0; + + + static struct option options[] = + { + { "help", no_argument, NULL, 'h' }, + { "verbose", optional_argument, NULL, 'V'}, + { "version", no_argument, NULL, 'v'}, + { "config", required_argument, NULL, 'c'}, + { "before", required_argument, NULL, 'B'}, + { "after", required_argument, NULL, 'A'}, + { "report", required_argument, NULL, 'r'}, + { "init", no_argument, NULL, 'i'}, + { "check", no_argument, NULL, 'C'}, + { "update", no_argument, NULL, 'u'}, + { "config-check", no_argument, NULL, 'D'}, + { "limit", required_argument, NULL, 'l'}, + { "compare", no_argument, NULL, 'E'}, + { NULL,0,NULL,0 } + }; + + while(1){ + option = getopt_long(argc, argv, "hV::vc:B:A:r:iCuDE", options, &i); + if(option==-1) + break; + switch(option) + { + case 'h':{ + usage(0); + break; + } + case 'v':{ + print_version(); + break; + } + case 'V':{ + if(optarg!=NULL){ + conf->verbose_level=strtol(optarg,&err,10); + if(*err!='\0' || conf->verbose_level>255 || conf->verbose_level<0 || + errno==ERANGE){ + error(0, _("Illegal verbosity level:%s\n"),optarg); + exit(INVALID_ARGUMENT_ERROR); + } + error(230,_("Setting verbosity to %s\n"),optarg); + }else{ + conf->verbose_level=20; + } + break; + } + case 'c':{ + if(optarg!=NULL){ + conf->config_file=optarg; + }else{ + error(0,_("No config-file name given!\n")); + exit(INVALID_ARGUMENT_ERROR); + } + break; + } + case 'B': { + if (optarg!=NULL) { + int errorno=commandconf('B',optarg); + if (errorno!=0){ + error(0,_("Configuration error in before statement:%s\n"),optarg); + exit(INVALID_CONFIGURELINE_ERROR); + } + } else { + error(0,_("-B must have a parameter\n")); + exit(INVALID_ARGUMENT_ERROR); + } + break; + } + case 'A': { + if (optarg!=NULL) { + int errorno=commandconf('A',optarg); + if (errorno!=0){ + error(0,_("Configuration error in after statement:%s\n"),optarg); + exit(INVALID_CONFIGURELINE_ERROR); + } + } else { + error(0,_("-A must have a parameter\n")); + exit(INVALID_ARGUMENT_ERROR); + } + break; + } + case 'l': { + if (optarg!=NULL) { + const char* pcre_error; + int pcre_erroffset; + conf->limit=malloc(strlen(optarg)+1); + strcpy(conf->limit,optarg); + if((conf->limit_crx=pcre_compile(conf->limit, PCRE_ANCHORED, &pcre_error, &pcre_erroffset, NULL)) == NULL) { + error(0,_("Error in limit regexp '%s' at %i: %s\n"), conf->limit, pcre_erroffset, pcre_error); + exit(INVALID_ARGUMENT_ERROR); + } + error(200,_("Limit set to '%s'\n"), conf->limit); + } else { + error(0,_("-l must have an argument\n")); + exit(INVALID_ARGUMENT_ERROR); + } + break; + } + case 'r': { + if(optarg!=NULL) { + do_repurldef(optarg); + }else { + error(0,_("-r must have an argument\n")); + } + break; + } + case 'i': { + if(conf->action==0){ + conf->action=DO_INIT; + }else { + error(0, + _("Cannot have multiple commands on a single commandline.\n")); + exit(INVALID_ARGUMENT_ERROR); + }; + break; + } + case 'C': { + if(conf->action==0){ + conf->action=DO_COMPARE; + }else { + error(0, + _("Cannot have multiple commands on a single commandline.\n")); + exit(INVALID_ARGUMENT_ERROR); + }; + break; + } + case 'u': { + if(conf->action==0){ + conf->action=DO_INIT|DO_COMPARE; + }else { + error(0, + _("Cannot have multiple commands on a single commandline.\n")); + exit(INVALID_ARGUMENT_ERROR); + }; + break; + } + case 'E': { + if(conf->action==0){ + conf->action=DO_DIFF; + }else { + error(0, + _("Cannot have multiple commands on a single commandline.\n")); + exit(INVALID_ARGUMENT_ERROR); + }; + break; + } + case 'D': { + conf->config_check=1; + break; + } + default: + error(0,_("Unknown option given. Exiting\n")); + exit(INVALID_ARGUMENT_ERROR); + } + } + + if(optinddefsyms=NULL; + + if (gethostname(s,MAXHOSTNAMELEN)==-1) { + error(0,_("Couldn't get hostname")); + free(s); + } else { + s=(char*)realloc((void*)s,strlen(s)+1); + do_define("HOSTNAME",s); + } + + /* Setting some defaults */ + conf->report_db=0; + conf->tree=NULL; + conf->config_check=0; + conf->verbose_level=-1; + conf->database_add_metadata=1; + conf->report_detailed_init=0; + conf->report_base16=0; + conf->report_quiet=0; + conf->use_initial_errorsto=1; + conf->report_url=NULL; + conf->report_fd=NULL; + conf->report_syslog=0; + conf->report_db=0; +#ifdef WITH_E2FSATTRS + conf->report_ignore_e2fsattrs = 0UL; +#endif + + u=parse_url(urlstr); + error_init(u,1); + + conf->config_file=CONFIG_FILE; + conf->config_version=NULL; + +#ifdef WITH_ACL + conf->no_acl_on_symlinks=0; /* zero means don't do ACLs on symlinks */ +#endif + +#ifdef WITH_MHASH + conf->do_configmd=0; + conf->confmd=NULL; + conf->confhmactype=CONFIGHMACTYPE; + conf->old_confmdstr=NULL; + conf->dbhmactype=DBHMACTYPE; + conf->dbnewmd=NULL; + conf->dboldmd=NULL; +#endif + + conf->do_dbnewmd=0; + conf->do_dboldmd=0; + conf->old_dbnewmdstr=NULL; + conf->old_dboldmdstr=NULL; + + conf->db_out_order=(DB_FIELD*)malloc(sizeof(DB_FIELD)*db_unknown); + conf->db_out_size=1; + conf->db_out_order[0]=db_filename; + conf->symlinks_found=0; + conf->db_in_size=0; + conf->db_in_order=NULL; + conf->db_in_url=NULL; + conf->db_in=NULL; + conf->db_new_size=0; + conf->db_new_order=NULL; + conf->db_new_url=NULL; + conf->db_new=NULL; + conf->db_out_url=NULL; + conf->db_out=NULL; + + conf->mdc_in=NULL; + conf->mdc_out=NULL; + + conf->line_db_in=NULL; + conf->line_db_out=NULL; + + conf->db_attrs = 0; +#if defined(WITH_MHASH) || defined(WITH_GCRYPT) + conf->db_attrs |= DB_MD5|DB_TIGER|DB_HAVAL|DB_CRC32|DB_SHA1|DB_RMD160|DB_SHA256|DB_SHA512; +#ifdef WITH_MHASH + conf->db_attrs |= DB_GOST; +#ifdef HAVE_MHASH_WHIRLPOOL + conf->db_attrs |= DB_WHIRLPOOL; +#endif +#endif +#endif + +#ifdef WITH_ZLIB + conf->db_gzin=0; + conf->db_gznew=0; + conf->gzip_dbout=0; + conf->db_gzout=0; +#endif + + conf->action=0; + conf->catch_mmap=0; + + conf->warn_dead_symlinks=0; + + conf->grouped=1; + + conf->summarize_changes=1; + + conf->root_prefix=""; + conf->root_prefix_length=0; + + conf->limit=NULL; + conf->limit_crx=NULL; + + conf->selrxlst=NULL; + conf->equrxlst=NULL; + conf->negrxlst=NULL; + + conf->groupsyms=NULL; + + conf->start_time=time(&(conf->start_time)); + + do_groupdef("ANF",DB_NEWFILE); + do_groupdef("ARF",DB_RMFILE); + do_groupdef("p",DB_PERM); + do_groupdef("i",DB_INODE); + do_groupdef("I",DB_CHECKINODE); + do_groupdef("n",DB_LNKCOUNT); + do_groupdef("u",DB_UID); + do_groupdef("g",DB_GID); + do_groupdef("l",DB_LINKNAME); + do_groupdef("s",DB_SIZE); + do_groupdef("S",DB_SIZEG); + do_groupdef("b",DB_BCOUNT); + do_groupdef("m",DB_MTIME); + do_groupdef("c",DB_CTIME); + do_groupdef("a",DB_ATIME); +#if defined(WITH_MHASH) || defined(WITH_GCRYPT) + do_groupdef("md5",DB_MD5); + do_groupdef("tiger",DB_TIGER); + do_groupdef("haval",DB_HAVAL); + do_groupdef("crc32",DB_CRC32); + do_groupdef("sha1",DB_SHA1); + do_groupdef("rmd160",DB_RMD160); + do_groupdef("sha256",DB_SHA256); + do_groupdef("sha512",DB_SHA512); +#endif +#ifdef WITH_ACL + do_groupdef("acl",DB_ACL); +#endif +#ifdef WITH_XATTR + do_groupdef("xattrs",DB_XATTRS); +#endif +#ifdef WITH_SELINUX + do_groupdef("selinux",DB_SELINUX); +#endif + +#ifdef WITH_MHASH + do_groupdef("gost",DB_GOST); +#ifdef HAVE_MHASH_WHIRLPOOL + do_groupdef("whirlpool",DB_WHIRLPOOL); +#endif +#endif + do_groupdef("ftype",DB_FTYPE); +#ifdef WITH_E2FSATTRS + do_groupdef("e2fsattrs",DB_E2FSATTRS); +#endif + + X=0LLU; +#ifdef WITH_ACL + X|=DB_ACL; +#endif +#ifdef WITH_SELINUX + X|=DB_SELINUX; +#endif +#ifdef WITH_XATTR + X|=DB_XATTRS; +#endif +#ifdef WITH_E2FSATTRS + X|=DB_E2FSATTRS; +#endif + + + do_groupdef("R",DB_PERM|DB_FTYPE|DB_INODE|DB_LNKCOUNT|DB_UID|DB_GID|DB_SIZE| + DB_LINKNAME|DB_MTIME|DB_CTIME +#if defined(WITH_MHASH) || defined(WITH_GCRYPT) + |DB_MD5 +#endif + |X); + + do_groupdef("L",DB_PERM|DB_FTYPE|DB_INODE|DB_LNKCOUNT|DB_UID|DB_GID|DB_LINKNAME|X); + + do_groupdef(">",DB_PERM|DB_FTYPE|DB_INODE|DB_LNKCOUNT|DB_UID|DB_GID|DB_SIZEG| + DB_LINKNAME|X); + do_groupdef("X",X); + do_groupdef("E",0); + +} + +static void setdefaults_after_config() +{ + if(conf->db_in_url==NULL){ + url_t* u=NULL; + u=(url_t*)malloc(sizeof(url_t)); + u->type=url_file; + u->value=DEFAULT_DB; + conf->db_in_url=u; + } + if(conf->db_out_url==NULL){ + url_t* u=NULL; + u=(url_t*)malloc(sizeof(url_t)); + u->type=url_file; + u->value=DEFAULT_DB_OUT; + conf->db_out_url=u; + } + if(conf->report_url==NULL){ + url_t* u=NULL; + + /* Don't free this one because conf->report_url needs it */ + u=(url_t*)malloc(sizeof(url_t)); + u->type=url_stdout; + u->value=""; + error_init(u,0); + } + if(conf->action==0){ + conf->action=DO_COMPARE; + } + if(conf->verbose_level==-1){ + conf->verbose_level=5; + } +} + + +int main(int argc,char**argv) +{ + int errorno=0; + byte* dig=NULL; + char* digstr=NULL; + +#ifdef USE_LOCALE + setlocale(LC_ALL,""); + bindtextdomain(PACKAGE,LOCALEDIR); + textdomain(PACKAGE); +#endif + umask(0177); + init_sighandler(); + + setdefaults_before_config(); + + if(read_param(argc,argv)==RETFAIL){ + error(0, _("Invalid argument\n") ); + exit(INVALID_ARGUMENT_ERROR); + } + + errorno=commandconf('C',conf->config_file); + + errorno=commandconf('D',""); + if (errorno==RETFAIL){ + error(0,_("Configuration error\n")); + exit(INVALID_CONFIGURELINE_ERROR); + } + + setdefaults_after_config(); + + /* + This won't actualy work, because conf->tree is not constructed. + Now we construct it. And we have THE tree. + */ + + conf->tree=gen_tree(conf->selrxlst,conf->negrxlst,conf->equrxlst); + + /* Let's do some sanity checks for the config */ + if(cmpurl(conf->db_in_url,conf->db_out_url)==RETOK){ + error(4,_("WARNING:Input and output database urls are the same.\n")); + if((conf->action&DO_INIT)&&(conf->action&DO_COMPARE)){ + error(0,_("Input and output database urls cannot be the same " + "when doing database update\n")); + exit(INVALID_ARGUMENT_ERROR); + } + if(conf->action&DO_DIFF){ + error(0,_("Both input databases cannot be the same " + "when doing database compare\n")); + exit(INVALID_ARGUMENT_ERROR); + } + }; + if((conf->action&DO_DIFF)&&(!(conf->db_new_url)||!(conf->db_in_url))){ + error(0,_("Must have both input databases defined for " + "database compare.\n")); + exit(INVALID_ARGUMENT_ERROR); + } + if (conf->action&(DO_INIT|DO_COMPARE) && conf->root_prefix_length > 0) { + DIR *dir; + if((dir = opendir(conf->root_prefix)) != NULL) { + closedir(dir); + } else { + char* er=strerror(errno); + if (er!=NULL) { + error(0,"opendir() for root prefix %s failed: %s\n", conf->root_prefix,er); + } else { + error(0,"opendir() for root prefix %s failed: %i\n", conf->root_prefix,errno); + } + exit(INVALID_ARGUMENT_ERROR); + } + } +#ifdef WITH_MHASH + if(conf->config_check&&FORCECONFIGMD){ + error(0,"Can't give config checksum when compiled with --enable-forced_configmd\n"); + exit(INVALID_ARGUMENT_ERROR); + } + + if((conf->do_configmd||conf->config_check)&& conf->confmd!=0){ + /* The patch automatically adds a newline so will also have to add it. */ + if(newlinelastinconfig==0){ + mhash(conf->confmd,"\n",1); + }; + mhash(conf->confmd, NULL,0); + dig=(byte*)malloc(sizeof(byte)*mhash_get_block_size(conf->confhmactype)); + mhash_deinit(conf->confmd,(void*)dig); + digstr=encode_base64(dig,mhash_get_block_size(conf->confhmactype)); + + if(!conf->config_check||FORCECONFIGMD){ + if(strncmp(digstr,conf->old_confmdstr,strlen(digstr))!=0){ + /* FIXME Don't use error and add configurability */ + error(0,_("Config checksum mismatch\n")); + exit(INVALID_ARGUMENT_ERROR); + } + } + } else { + if(FORCECONFIGMD){ + error(0,_("Config checksum not found. Exiting..\n")); + exit(INVALID_ARGUMENT_ERROR); + } + } +#endif + conf->use_initial_errorsto=0; + if (!conf->config_check) { + if(conf->action&DO_INIT){ + if(db_init(DB_WRITE)==RETFAIL) { + exit(IO_ERROR); + } + /* FIXME db_out_order info should be taken from tree/config */ + /* update_db_out_order(-1); OOPS. It was allready done by append_rxlist + :) */ + if(db_writespec(conf)==RETFAIL){ + error(0,_("Error while writing database. Exiting..\n")); + exit(IO_ERROR); + } + } + if((conf->action&DO_INIT)||(conf->action&DO_COMPARE)){ + if(db_init(DB_DISK)==RETFAIL) + exit(IO_ERROR); + } + if((conf->action&DO_COMPARE)||(conf->action&DO_DIFF)){ + if(db_init(DB_OLD)==RETFAIL) + exit(IO_ERROR); + } + if(conf->action&DO_DIFF){ + if(db_init(DB_NEW)==RETFAIL) + exit(IO_ERROR); + } + + populate_tree(conf->tree); + db_close(); + + exit(gen_report(conf->tree)); + + }else { +#ifdef WITH_MHASH + if(conf->confmd){ + error(0,"Config checked. Use the following to patch your config file.\n"); + error(0,"0a1\n"); + if(newlinelastinconfig==1){ + error(0,"> @@begin_config %s\n%lia%li\n> @@end_config\n",digstr,conf_lineno-1,conf_lineno+1); + }else { + error(0,"> @@begin_config %s\n%lia%li\n> @@end_config\n",digstr,conf_lineno,conf_lineno+2); + } + free(dig); + free(digstr); + } +#endif + } + return RETOK; +} +const char* aide_key_3=CONFHMACKEY_03; +const char* db_key_3=DBHMACKEY_03; + +// vi: ts=8 sw=8 diff --git a/src/base64.c b/src/base64.c new file mode 100644 index 0000000..6c717fa --- /dev/null +++ b/src/base64.c @@ -0,0 +1,325 @@ +/* +** +** Copyright (C) 1994 Swedish University Network (SUNET) +** Modified by Rami Lehti (C) 1999 +** $Header$ +** +** +** 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 FITTNESS 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., 675 Mass Ave, Cambridge, MA 02139, USA. +** +** +** Martin.Wendel@udac.uu.se +** Torbjorn.Wictorin@udac.uu.se +** +** UDAC +** P.O. Box 174 +** S-751 04 Uppsala +** Sweden +** +*/ + +#include "aide.h" +#include +#include +#include +#include "base64.h" +#include "report.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +char tob64[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + + +int fromb64[] = { +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, SKIP, SKIP, FAIL, FAIL, SKIP, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, + +SKIP, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, 0x3e, FAIL, FAIL, FAIL, 0x3f, +0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, +0x3c, 0x3d, FAIL, FAIL, FAIL, SKIP, FAIL, FAIL, + +FAIL, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, +0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, +0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, +0x17, 0x18, 0x19, FAIL, FAIL, FAIL, FAIL, FAIL, + +FAIL, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, +0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, +0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, +0x31, 0x32, 0x33, FAIL, FAIL, FAIL, FAIL, FAIL, + +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, +FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL +}; + +/* Returns NULL on error */ +/* FIXME Possible buffer overflow on outputs larger than B64_BUF */ +char* encode_base64(byte* src,size_t ssize) +{ + char* outbuf; + char* retbuf; + int pos; + int i, l, left; + unsigned long triple; + byte *inb; + + error(235, "encode base64"); + /* Exit on empty input */ + if (!ssize||src==NULL){ + error(240,"\n"); + return NULL; + } + outbuf = (char *)malloc(sizeof(char)*B64_BUF); + + /* Initialize working pointers */ + inb = src; + i = 0; + triple = 0; + pos = 0; + left = ssize; + error(235, ", data length: %d\n", left); + /* + * Process entire inbuf. + */ + while (left != 0) + { + i++; + left--; + + triple = (triple <<8) | *inb; + if (i == 3 || left == 0) + { + switch (i) + { + case 1: + triple = triple<<4; + break; + case 2: + triple = triple<<2; + break; + default: + break; + } + for (l = i; l >= 0; l--){ + /* register */ + int rr; + rr = 0x3f & (triple>>(6*l)); + assert (rr < 64); + outbuf[pos]=tob64[rr]; + pos++; + } + if (left == 0) + switch(i) + { + case 2: + outbuf[pos]='='; + pos++; + break; + case 1: + outbuf[pos]='='; + pos++; + outbuf[pos]='='; + pos++; + break; + default: + break; + } + triple = 0; + i = 0; + } + inb++; + } + + /* outbuf is not completely used so we use retbuf */ + retbuf=(char*)malloc(sizeof(char)*(pos+1)); + memcpy(retbuf,outbuf,pos); + retbuf[pos]='\0'; + free(outbuf); + + return retbuf; +} + +/* FIXME Possible buffer overflow on outputs larger than B64_BUF */ +byte* decode_base64(char* src,size_t ssize, size_t *ret_len) +{ + byte* outbuf; + byte* retbuf; + char* inb; + int i; + int l; + int left; + int pos; + unsigned long triple; + + error(235, "decode base64\n"); + /* Exit on empty input */ + if (!ssize||src==NULL) + return NULL; + + + /* Initialize working pointers */ + inb = src; + outbuf = (byte *)malloc(sizeof(byte)*B64_BUF); + + l = 0; + triple = 0; + pos=0; + left = ssize; + /* + * Process entire inbuf. + */ + while (left != 0) + { + left--; + i = fromb64[(unsigned char)*inb]; + switch(i) + { + case FAIL: + error(3, "decode_base64: Illegal character: %c\n", *inb); + error(230, "decode_base64: Illegal line:\n%s\n", src); + return NULL; + break; + case SKIP: + break; + default: + triple = triple<<6 | (0x3f & i); + l++; + break; + } + if (l == 4 || left == 0) + { + switch(l) + { + case 2: + triple = triple>>4; + break; + case 3: + triple = triple>>2; + break; + default: + break; + } + for (l -= 2; l >= 0; l--) + { + outbuf[pos]=( 0xff & (triple>>(l*8))); + pos++; + } + triple = 0; + l = 0; + } + inb++; + } + + retbuf=(byte*)malloc(sizeof(byte)*(pos+1)); + memcpy(retbuf,outbuf,pos); + retbuf[pos]='\0'; + + free(outbuf); + + if (ret_len) *ret_len = pos; + + return retbuf; +} + +size_t length_base64(char* src,size_t ssize) +{ + char* inb; + int i; + int l; + int left; + size_t pos; + unsigned long triple; + + error(235, "decode base64\n"); + /* Exit on empty input */ + if (!ssize||src==NULL) + return 0; + + + + /* Initialize working pointers */ + inb = src; + + l = 0; + triple = 0; + pos=0; + left = ssize; + /* + * Process entire inbuf. + */ + while (left != 0) + { + left--; + i = fromb64[(unsigned char)*inb]; + switch(i) + { + case FAIL: + error(3, "length_base64: Illegal character: %c\n", *inb); + error(230, "length_base64: Illegal line:\n%s\n", src); + return 0; + break; + case SKIP: + break; + default: + triple = triple<<6 | (0x3f & i); + l++; + break; + } + if (l == 4 || left == 0) + { + switch(l) + { + case 2: + triple = triple>>4; + break; + case 3: + triple = triple>>2; + break; + default: + break; + } + for (l -= 2; l >= 0; l--) + { + pos++; + } + triple = 0; + l = 0; + } + inb++; + } + + return pos; +} + diff --git a/src/be.c b/src/be.c new file mode 100644 index 0000000..054f821 --- /dev/null +++ b/src/be.c @@ -0,0 +1,374 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2003,2005,2006,2010,2011,2013 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include +#include +#include +#include +#include +#include "db_config.h" +#include "db_file.h" +#include "report.h" +#include "util.h" +#ifdef WITH_CURL +#include "fopen.h" +#endif +#include "be.h" + +#ifdef WITH_PSQL +#include "libpq-fe.h" +#endif +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#ifdef WITH_PSQL +static int be_sql_readinit(psql_data* ret) { + /* Yes.. we don't want to know about two first result.. + and we want no memoryleaking. + */ + int i,j,nFields; + char* s; + char declare []="DECLARE aidecursor CURSOR FOR select * from "; + + s = (char*)malloc(strlen(declare)+strlen(ret->table)+1); + s[0]=0; + s=strcat(s,declare); + s=strcat(s,ret->table); + + ret->res=PQexec(ret->conn,s); + + if (!ret->res || PQresultStatus(ret->res) != PGRES_COMMAND_OK) { + + if (ret->res!=NULL) { + error(255,"Psql error: %s\n",PQresStatus(PQresultStatus(ret->res))); + PQclear(ret->res); + } + return RETFAIL; + } + PQclear(ret->res); + + ret -> res = PQexec(ret->conn, "FETCH ALL in aidecursor"); + + if (!ret->res || PQresultStatus(ret->res) != PGRES_TUPLES_OK) + { + error(0, "FETCH ALL command didn't return tuples properly\n"); + PQclear(ret->res); + abort(); + } + + + /* first, print out the attribute names */ + nFields = PQnfields(ret->res); + for (i = 0; i < nFields; i++) + error(255,"%-15s", PQfname(ret->res, i)); + error(255,"\n\n"); + + + for(i=0;ides[i]=PQfnumber(ret->res,db_names[i]); + if (ret->des[i]!=-1) { + error(255,"Field %i,%s \n",ret->des[i],db_names[i]); + } + } + + ret->curread=0; + ret->maxread=PQntuples(ret->res); + /* And now we know how many fields we have.. */ + + error(0,"%i tuples\n",ret->maxread); + + return RETOK; + +} + +static char* get_first_value(char** in){ + int i=0; + char* ret = (*in); + while((*in)[i]!=':' && (*in)[i]!='\0') { + i++; + } + if ((*in)[i]!='\0') { /* Lets not go beond the sting.. */ + (*in)[i]='\0'; + (*in)+=i+1; + } + return ret; +} + +#endif + +FILE* be_init(int inout,url_t* u,int iszipped) +{ + FILE* fh=NULL; + long a=0; + char* err=NULL; + int fd; +#if HAVE_FCNTL && HAVE_FTRUNCATE + struct flock fl; +#endif + + if (u==NULL) { + return NULL; + } + + switch (u->type) { + case url_file : { + u->value = expand_tilde(u->value); + error(200,_("Opening file \"%s\" for %s\n"),u->value,inout?"r":"w+"); +#if HAVE_FCNTL && HAVE_FTRUNCATE + fd=open(u->value,inout?O_RDONLY:O_CREAT|O_RDWR,0666); +#else + fd=open(u->value,inout?O_RDONLY:O_CREAT|O_RDWR|O_TRUNC,0666); +#endif + error(255,"Opened file \"%s\" with fd=%i\n",u->value,fd); + if(fd==-1) { + error(0,_("Couldn't open file %s for %s"),u->value, + inout?"reading\n":"writing\n"); + return NULL; + } +#if HAVE_FCNTL && HAVE_FTRUNCATE + if(!inout) { + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 0; + if (fcntl(fd, F_SETLK, &fl) == -1) { + if (fcntl(fd, F_SETLK, &fl) == -1) + error(0,_("File %s is locked by another process.\n"),u->value); + else + error(0,_("Cannot get lock for file %s"),u->value); + return NULL; + } + if(ftruncate(fd,0)==-1) + error(0,_("Error truncating file %s"),u->value); + + } +#endif +#ifdef WITH_ZLIB + if(iszipped && !inout){ + fh=gzdopen(fd,"wb9"); + if(fh==NULL){ + error(0,_("Couldn't open file %s for %s"),u->value, + inout?"reading\n":"writing\n"); + } + } + else{ +#endif + fh=fdopen(fd,inout?"r":"w+"); + if(fh==NULL){ + error(0,_("Couldn't open file %s for %s"),u->value, + inout?"reading\n":"writing\n"); + } +#ifdef WITH_ZLIB + } +#endif + return fh; + } + case url_stdout : { +#ifdef WITH_ZLIB + if(iszipped){ + return gzdopen(fileno(stdout),"wb"); + } + else{ +#endif + return stdout; +#ifdef WITH_ZLIB + } +#endif + } + case url_stdin : { +#ifdef WITH_ZLIB + if(iszipped){ + return gzdopen(fileno(stdin),"r"); + } + else{ +#endif + return stdin; +#ifdef WITH_ZLIB + } +#endif + } + case url_stderr : { +#ifdef WITH_ZLIB + if(iszipped){ + return gzdopen(fileno(stderr),"wb"); + } + else{ +#endif + return stderr; +#ifdef WITH_ZLIB + } +#endif + } + case url_fd : { + a=strtol(u->value,&err,10); + if(*err!='\0'||errno==ERANGE){ + error(0,"Illegal file descriptor value:%s\n",u->value); + } +#ifdef WITH_ZLIB + if(iszipped && !inout){ + fh=gzdopen(a,"w"); + if(fh==NULL){ + error(0,"Couldn't reopen file descriptor %li\n",a); + } + } + else{ +#endif + fh=fdopen(a,inout?"r":"w"); + if(fh==NULL){ + error(0,"Couldn't reopen file descriptor %li\n",a); + } +#ifdef WITH_ZLIB + } +#endif + return fh; + } +#ifdef WITH_PSQL + case url_sql : { + char *pghost, *pgport, *pgoptions, *pgtty, *dbName, *login, *pwd; + char *tmp,*tmp2; + + psql_data* ret = (psql_data*) malloc(sizeof(psql_data)*1); + + if (ret==NULL) { + error(0,"Not enough memory for postgres sql connection\n"); + return ret; + } + + tmp=strdup(u->value); + tmp2=tmp; + + pgtty=NULL;pgoptions=NULL; + + if ((pghost=get_first_value(&tmp)) == NULL) { + error(0,"Must define host for Postgres sql connection\n"); + free(tmp2); + return NULL; + } else { + error(100,"Psql host is %s\n",pghost); + if ((pgport=get_first_value(&tmp)) == NULL) { + error(0,"Must define port for Postgres sql connection\n"); + free(tmp2); + return NULL; + } else { + error(100,"Psql port is %s\n",pgport); + if ((dbName=get_first_value(&tmp)) == NULL) { + error(0,"Must define name for database for Postgres sql connection\n"); + free(tmp2); + return NULL; + } else { + error(100,"Psql db is %s\n",dbName); + if ((login=get_first_value(&tmp)) == NULL) { + error(0,"Must define login for Postgres sql connection\n"); + free(tmp2); + return NULL; + } else { + error(100,"Psql login is %s\n",login); + if ((pwd=get_first_value(&tmp)) == NULL) { + error(0,"Must define password for database for Postgres sql connection\n"); + free(tmp2); + return NULL; + } else { + error(100,"Psql passwd is %s\n",pwd); + if ((ret->table=get_first_value(&tmp))==NULL) { + error(0,"Must define table for sql..\n"); + free(tmp2); + return NULL; + } else { + if (ret->table[0]=='\0') { + error(0,"Must define table for sql..\n"); + free(tmp2); + return NULL; + } else { + /* everything went ok.. */ + } + } + } + } + } + } + } + + if (login[0] == '\0' ) { + login = NULL; + } + if (pwd[0] == '\0' ) { + pwd = NULL; + } + + ret->conn = PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,login,pwd); + if (PQstatus(ret->conn) == CONNECTION_BAD){ + error(0,"Postgres sql error during connection\n"); + free(tmp2); + return NULL; + } + /* Otherwise we would become to situation that name of table would + be freeed + */ + ret->table = strdup(ret->table); + + /* And now we have made a connection to database.. + Next thing we do is to begin a new transaction block */ + + ret->res = PQexec(ret->conn, "BEGIN"); + + if (!ret->res || PQresultStatus(ret->res) != PGRES_COMMAND_OK) { + error(0,"BEGIN command failed... \n"); + PQclear(ret->res); + free(ret); + ret=NULL; + } else { + PQclear(ret->res); + if ((inout?be_sql_readinit(ret):RETOK)!=RETOK) { + error(255,"Something went wrong with sql backend init.\n"); + return NULL; + } + } + free(tmp2); + return ret; + } +#endif +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: + { + error(200,_("Opening curl \"%s\" for %s\n"),u->value,inout?"r":"w+"); + if (iszipped) { + return NULL; + } + return url_fopen(u->value,inout?"r":"w+"); + } +#endif /* WITH CURL */ + default:{ + error(0,"Unsupported backend: %i", u->type); + return NULL; + } + } + /* Not reached */ + return NULL; + +} + +const char* aide_key_8=CONFHMACKEY_08; +const char* db_key_8=DBHMACKEY_08; diff --git a/src/commandconf.c b/src/commandconf.c new file mode 100644 index 0000000..eb9e382 --- /dev/null +++ b/src/commandconf.c @@ -0,0 +1,1117 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2006,2010,2011,2013,2015,2016 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include +#include +#include +#include +#include + +#include "commandconf.h" +#include "conf_lex.h" +#include "conf_yacc.h" +#include "db.h" +#include "db_config.h" +#include "gen_list.h" +#include "symboltable.h" +#include "md.h" +#include "util.h" +#include "base64.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ +#ifdef WITH_CURL +#include "fopen.h" +#endif + +#define BUFSIZE 4096 +#define ZBUFSIZE 16384 + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 256 +#endif + +int commandconf(const char mode,const char* line) +{ + static char* before=NULL; + static char* config=NULL; + static char* after=NULL; + char* all=NULL; + char* tmp=NULL; + int l=0; + + switch(mode){ + case 'B':{ + if(before==NULL){ + before=strdup(line); + } + else { + tmp=(char*)malloc(sizeof(char) + *(strlen(before)+strlen(line)+2)); + tmp[0]='\0'; + strcat(tmp,before); + strcat(tmp,"\n"); + strcat(tmp,line); + free(before); + before=tmp; + } + break; + } + case 'C':{ + config=strdup(line); + break; + } + case 'A':{ + if(after==NULL){ + after=strdup(line); + } + else { + tmp=(char*)malloc(sizeof(char) + *(strlen(after)+strlen(line)+2)); + strcpy(tmp,after); + strcat(tmp,"\n"); + strcat(tmp,line); + free(after); + after=tmp; + } + break; + } + case 'D': { + /* Let's do it */ + int rv=-1; + + config = expand_tilde(config); + if (config!=NULL && strcmp(config,"-")==0) { + error(255,_("Config from stdin\n")); + rv=0; + } else { + + rv=access(config,R_OK); + if(rv==-1){ + error(0,_("Cannot access config file: %s: %s\n"),config,strerror(errno)); + } + } + + if(before==NULL&&after==NULL&& + (config==NULL||strcmp(config,"")==0||rv==-1)){ + error(0,_("No config defined\n")); + return RETFAIL; + } + if(before!=NULL) { + l+=strlen(before); + } + if(config!=NULL) { + l+=strlen(config); + } + if(after!=NULL) { + l+=strlen(after); + } + l+=strlen("@@include \n\n\n")+1; + + all=(char*)malloc(sizeof(char)*l); + + memset(all,0,l); + if(before!=NULL){ + strcat(all,before); + strcat(all,"\n"); + } + strcat(all,"@@include "); + strcat(all,config); + strcat(all,"\n"); + if(after!=NULL){ + strcat(all,after); + strcat(all,"\n"); + } + + error(200,"commandconf():%s\n",all); + + conf_scan_string(all); + + if(confparse()){ + free(all); + return RETFAIL; + } + free(all); + + break; + } + default: { + error(0,_("Illegal argument %c to commmandconf()\n"),mode); + break; + } + } + return RETOK; +} + +int conf_input_wrapper(char* buf, int max_size, FILE* in) +{ + int retval=0; + int c=0; + char* tmp=NULL; + void* key=NULL; + int keylen=0; + + /* FIXME Add support for gzipped config. :) */ +#ifdef WITH_MHASH + /* Read a character at a time until we are doing md */ + if(conf->do_configmd){ + retval=fread(buf,1,max_size,in); + }else { + c=fgetc(in); + retval= (c==EOF) ? 0 : (buf[0] = c,1); + } +#else + retval=fread(buf,1,max_size,in); +#endif + +#ifdef WITH_MHASH + if(conf->do_configmd||conf->config_check){ + if(((conf->do_configmd==1)&&conf->config_check)||!conf->confmd){ + if(conf->do_configmd==1){ + conf->do_configmd+=1; + } + if((key=get_conf_key())!=NULL){ + keylen=get_conf_key_len(); + + if( (conf->confmd= + mhash_hmac_init(conf->confhmactype, + key, + keylen, + mhash_get_hash_pblock(conf->confhmactype)))== + MHASH_FAILED){ + error(0, "mhash_hmac_init() failed for %i for config check. Aborting\n", + conf->confhmactype); + exit(EXIT_FAILURE); + } + } else { + conf->do_configmd=0; + return retval; + } + } + /* FIXME This does not handle the case that @@end_config is on + buffer boundary. */ + if((tmp=strnstr(buf,"@@end_config",retval))!=NULL){ + /* We have end of config don't feed the last line to mhash */ + mhash(conf->confmd,(void*)buf,tmp-buf); + } else { + mhash(conf->confmd,(void*)buf,retval); + } + } +#endif + return retval; +} + +int db_input_wrapper(char* buf, int max_size, int db) +{ + int retval=0; + int c=0; + int err=0; + int* domd=NULL; +#ifdef WITH_CURL + url_t* db_url=NULL; +#endif +#ifdef WITH_MHASH + char* tmp=NULL; + MHASH* md=NULL; + void* key=NULL; + int keylen; +#endif + FILE** db_filep=NULL; +#ifdef WITH_ZLIB + gzFile* db_gzp=NULL; +#endif + struct md_container *mdc; + switch(db) { + case DB_OLD: { +#ifdef WITH_CURL + db_url=conf->db_in_url; +#endif + + domd=&(conf->do_dboldmd); +#ifdef WITH_MHASH + md=&(conf->dboldmd); +#endif + + db_filep=&(conf->db_in); + +#ifdef WITH_ZLIB + db_gzp=&(conf->db_gzin); +#endif + break; + } + case DB_NEW: { +#ifdef WITH_CURL + db_url=conf->db_new_url; +#endif + + domd=&(conf->do_dbnewmd); +#ifdef WITH_MHASH + md=&(conf->dbnewmd); +#endif + + db_filep=&(conf->db_new); + +#ifdef WITH_ZLIB + db_gzp=&(conf->db_gznew); +#endif + break; + } + } + +#ifdef WITH_CURL + switch (db_url->type) { + case url_http: + case url_https: + case url_ftp: { + retval=url_fread(buf,1,max_size,(URL_FILE *)*db_filep); + if ((mdc = (db == DB_OLD ? conf->mdc_in : conf->mdc_out))) { + update_md(mdc, buf, retval); + } + break; + } + default: +#endif /* WITH CURL */ + + + /* Read a character at a time until we are doing md */ +#ifdef WITH_ZLIB + if((*db_gzp==NULL)&&(*domd)){ + retval=fread(buf,1,max_size,*db_filep); + } + if((*db_gzp!=NULL)&&(*domd)){ + if(gzeof(*db_gzp)){ + retval=0; + buf[0]='\0'; + }else { + if((retval=gzread(*db_gzp,buf,max_size))<0){ + error(0,_("gzread() failed: gzerr=%s!\n"),gzerror(*db_gzp,&err)); + retval=0; + buf[0]='\0'; + } else { + /* gzread returns 0 even if uncompressed bytes were read*/ + error(240,"nread=%d,strlen(buf)=%lu,errno=%s,gzerr=%s\n", + retval,(unsigned long)strnlen((char*)buf, max_size), + strerror(errno),gzerror(*db_gzp,&err)); + if(retval==0){ + retval=strnlen((char*)buf, max_size); + } + } + } + } + if((*db_gzp!=NULL)&&!(*domd)){ + c=gzgetc(*db_gzp); + retval= (c==EOF) ? 0 : (buf[0] = c,1); + } + if((*db_gzp==NULL)&&!(*domd)){ + c=fgetc(*db_filep); + if(c==(unsigned char)'\037'){ + c=fgetc(*db_filep); + if(c==(unsigned char)'\213'){ + /* We got gzip header. */ + error(255,"Got Gzip header. Handling..\n"); + lseek(fileno(*db_filep),0L,SEEK_SET); + *db_gzp=gzdopen(fileno(*db_filep),"rb"); + c=gzgetc(*db_gzp); + error(255,"First character after gzip header is: %c(%#X)\n",c,c); + if(c==-1) { + int xx; + error(0,"Error reading gzipped file: %s\n",gzerror(*db_gzp,&xx)); + exit(EXIT_FAILURE); + } + }else { + /* False alarm */ + ungetc(c,*db_filep); + } + } + retval= (c==EOF) ? 0 : (buf[0] = c,1); + } + +#else /* WITH_ZLIB */ +#ifdef WITH_MHASH + if(*domd){ + retval=fread(buf,1,max_size,*db_filep); + }else { + c=fgetc(*db_filep); + retval= (c==EOF) ? 0 : (buf[0] = c,1); + } +#else /* WITH_MHASH */ + retval=fread(buf,1,max_size,*db_filep); +#endif /* WITH_MHASH */ +#endif /* WITH_ZLIB */ + + if ((mdc = (db == DB_OLD ? conf->mdc_in : conf->mdc_out))) { + update_md(mdc, buf, retval); + } + +#ifdef WITH_MHASH + if(*domd){ + if(!*md){ + if((key=get_db_key())!=NULL){ + keylen=get_db_key_len(); + + if( (*md= + mhash_hmac_init(conf->dbhmactype, + key, + keylen, + mhash_get_hash_pblock(conf->dbhmactype)))== + MHASH_FAILED){ + error(0, "mhash_hmac_init() failed for db check. Aborting\n"); + exit(EXIT_FAILURE); + } + } else { + *domd=0; + } + } + /* FIXME This does not handle the case that @@end_config is on + buffer boundary. */ + if (*domd!=0) { + if((tmp=strnstr(buf,"@@end_db",retval))!=NULL){ + /* We have end of db don't feed the last line to mhash */ + mhash(*md,(void*)buf,tmp-buf); + /* We don't want to come here again after the *md has been deinited + by db_readline_file() */ + *domd=0; + } else { + mhash(*md,(void*)buf,retval); + } + } + } +#endif + +#ifdef WITH_CURL + } +#endif /* WITH CURL */ + return retval; +} + +int check_db_order(DB_FIELD* d,int size, DB_FIELD a) +{ + int i; + for(i=0;idb_out_order,conf->db_out_size,a); +} + +void update_db_out_order(DB_ATTR_TYPE attr) +{ + /* First we add those attributes that must be there */ + if (check_dboo(db_linkname)==RETOK) { + conf->db_out_order[conf->db_out_size++]=db_linkname; + } + if (check_dboo(db_attr)==RETOK) { + conf->db_out_order[conf->db_out_size++]=db_attr; + } + if(check_dboo(db_perm)==RETOK){ + conf->db_out_order[conf->db_out_size++]=db_perm; + } + if(check_dboo(db_inode)==RETOK){ + conf->db_out_order[conf->db_out_size++]=db_inode; + } + if((attr&DB_BCOUNT) && (check_dboo(db_bcount)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_bcount; + } + if((attr&DB_UID) && (check_dboo(db_uid)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_uid; + } + if((attr&DB_GID) && (check_dboo(db_gid)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_gid; + } + if((attr&DB_SIZE) && (check_dboo(db_size)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_size; + } + if((attr&DB_SIZEG) && (check_dboo(db_size)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_size; + } + if((attr&DB_ATIME) && (check_dboo(db_atime)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_atime; + } + if((attr&DB_MTIME) && (check_dboo(db_mtime)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_mtime; + } + if((attr&DB_CTIME) && (check_dboo(db_ctime)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_ctime; + } + if((attr&DB_LNKCOUNT) && (check_dboo(db_lnkcount)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_lnkcount; + } + if((attr&DB_MD5) && (check_dboo(db_md5)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_md5; + } + if((attr&DB_SHA1) && (check_dboo(db_sha1)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_sha1; + } + if((attr&DB_RMD160) && (check_dboo(db_rmd160)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_rmd160; + } + if((attr&DB_TIGER) && (check_dboo(db_tiger)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_tiger; + } + if((attr&DB_CRC32) && (check_dboo(db_crc32)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_crc32; + } + if((attr&DB_HAVAL) && (check_dboo(db_haval)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_haval; + } + /* +#ifdef WITH_MHASH + */ + if((attr&DB_GOST) && (check_dboo(db_gost)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_gost; + } + if((attr&DB_WHIRLPOOL) && (check_dboo(db_whirlpool)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_whirlpool; + } + if((attr&DB_CRC32B) && (check_dboo(db_crc32b)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_crc32b; + } + /* +#endif + */ + if((attr&DB_SHA256) && (check_dboo(db_sha256)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_sha256; + } + if((attr&DB_SHA512) && (check_dboo(db_sha512)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_sha512; + } +#ifdef WITH_ACL + if((attr&DB_ACL) && (check_dboo(db_acl)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_acl; + } +#endif + if((attr&DB_XATTRS) && (check_dboo(db_xattrs)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_xattrs; + } + if((attr&DB_SELINUX) && (check_dboo(db_selinux)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_selinux; + } + if((attr&DB_E2FSATTRS) && (check_dboo(db_e2fsattrs)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_e2fsattrs; + } + if((attr&DB_CHECKMASK) && (check_dboo(db_checkmask)!=RETFAIL)){ + conf->db_out_order[conf->db_out_size++]=db_checkmask; + } +} + + +char* get_variable_value(char* var) +{ + list* r=NULL; + + if((r=list_find(var,conf->defsyms))){ + return (((symba*)r->data)->value); + }; + + return NULL; +} + +void putbackvariable(char* var) +{ + char* a=NULL; + + char* v=strdup(var); + + char* subst_begin=strstr(v,"@@{"); + char* subst_end=strstr(subst_begin,"}"); + + char* tmp=(char*)malloc((subst_end-subst_begin)+1); + + tmp = strncpy(tmp,subst_begin+3,subst_end-subst_begin-3); + + tmp[subst_end-subst_begin-3]='\0'; + + conf_put_token(subst_end+1); + + if((a=get_variable_value(tmp))!=NULL){ + conf_put_token(a); + } + else { + + error(230,_("Variable %s not defined\n"),tmp); + + /* + * We can use nondefined variable + */ + } + + subst_begin[0]='\0'; + + conf_put_token(v); + conf_put_token("\n"); + free(v); + free(tmp); + +} + + +void do_define(char* name, char* value) +{ + symba* s=NULL; + list* l=NULL; + + if(!(l=list_find(name,conf->defsyms))){ + s=(symba*)malloc(sizeof(symba)); + s->name=name; + s->value=value; + conf->defsyms=list_append(conf->defsyms,(void*)s); + } + else { + free(((symba*)l->data)->value); + ((symba*)l->data)->value=NULL; + ((symba*)l->data)->value=value; + } +} + +void do_undefine(char* name) +{ + list*r=NULL; + + if((r=list_find(name,conf->defsyms))){ + free(((symba*)r->data)->value); + free((symba*)r->data); + r->data=NULL; + conf->defsyms=list_delete_item(r); + } +} + +int handle_endif(int doit,int allow_else){ + + if(doit){ + int count=1; + error(230,_("\nEating until @@endif\n")); + do { + int i = conflex(); + switch (i) { + case TIFDEF : { + count++; + break; + } + case TIFNDEF : { + count++; + break; + } + case TENDIF : { + count--; + break; + } + + case TIFHOST : { + count++; + break; + } + + case TIFNHOST : { + count++; + break; + } + + case TELSE : { + + if (count==1) { + /* + * We have done enough + */ + if (allow_else) { + return 0; + } + else { + conferror("Ambiguous else"); + return -1; + } + } + + break; + } + + case 0 : { + conferror("@@endif or @@else expected"); + return -1; + count=0; + } + + default : { + /* + * empty default + */ + } + } + + + } while (count!=0); + + conf_put_token("\n@@endif\n"); + error(230,"\nEating done\n"); + } + + return 0; + +} + +int do_ifxdef(int mode,char* name) +{ + int doit; + doit=mode; + + if((list_find(name,conf->defsyms))){ + doit=1-doit; + } + + return (handle_endif(doit,1)); + +} + +int do_ifxhost(int mode,char* name) +{ + int doit; + char* s=NULL; + char *p; + doit=mode; + s=(char*)malloc(sizeof(char)*MAXHOSTNAMELEN+1); + if (s == NULL) { + error(0,_("Couldn't malloc hostname buffer")); + } + s[MAXHOSTNAMELEN] = '\0'; + + if(gethostname(s,MAXHOSTNAMELEN)==-1){ + error(0,_("Couldn't get hostname %s"),name); + free(s); + return -1; + } + /* strip off everything past the . */ + p = strchr(s, '.'); + if (p != NULL) { + *p = '\0'; + } + if(strcmp(name,s)==0) { + doit=1-doit; + } + free(s); + return (handle_endif(doit,1)); +} + +list* append_rxlist(char* rx,DB_ATTR_TYPE attr,list* rxlst, RESTRICTION_TYPE restriction) +{ + extern long conf_lineno; /* defined & set in conf_lex.l */ + + rx_rule* r=NULL; + r=(rx_rule*)malloc(sizeof(rx_rule)); + r->rx=rx; + r->attr=attr; + r->conf_lineno = conf_lineno; + r->restriction = restriction; + if (attr&DB_CHECKINODE && attr&DB_CTIME) + error(20,"Rule at line %li has c and I flags enabled at the same time. If same inode is found, flag c is ignored\n",conf_lineno); + update_db_out_order(r->attr); + rxlst=list_append(rxlst,(void*)r); + + return rxlst; +} + +void do_groupdef(char* group,DB_ATTR_TYPE value) +{ + list* r=NULL; + symba* s=NULL; + + if (strcmp(group, "ignore_list") == 0) { + error(2, "DEPRECATION WARNING, Using '%s' is deprecated. Update your config and use '%s' instead.\n", group, "report_ignore_changed_attrs"); + group = "report_ignore_changed_attrs"; + } else if (strcmp(group, "report_attributes") == 0) { + error(2, "DEPRECATION WARNING, Using '%s' is deprecated. Update your config and use '%s' instead.\n", group, "report_force_attrs"); + group = "report_force_attrs"; + } + + if((r=list_find(group,conf->groupsyms))){ + error(2, "Warning: group '%s' is redefined\n", group); + ((symba*)r->data)->ival=value; + return; + } + /* This is a new group */ + s=(symba*)malloc(sizeof(symba)); + s->name=group; + s->ival=value; + conf->groupsyms=list_append(conf->groupsyms,(void*)s); +} + +RESTRICTION_TYPE get_restrictionval(char* ch) { + if (strcmp(ch, "f") == 0) { return RESTRICTION_FT_REG; } + else if (strcmp(ch, "d") == 0) { return RESTRICTION_FT_DIR; } + else if (strcmp(ch, "p") == 0) { return RESTRICTION_FT_FIFO; } + else if (strcmp(ch, "l") == 0) { return RESTRICTION_FT_LNK; } + else if (strcmp(ch, "b") == 0) { return RESTRICTION_FT_BLK; } + else if (strcmp(ch, "c") == 0) { return RESTRICTION_FT_CHR; } + else if (strcmp(ch, "s") == 0) { return RESTRICTION_FT_SOCK; } + else if (strcmp(ch, "D") == 0) { return RESTRICTION_FT_DOOR; } + else if (strcmp(ch, "P") == 0) { return RESTRICTION_FT_PORT; } + else { return RESTRICTION_NULL; } +} + +DB_ATTR_TYPE get_groupval(char* group) +{ + list* r=NULL; + + if((r=list_find(group,conf->groupsyms))){ + return (((symba*)r->data)->ival); + } + return -1; +} + +void do_dbdef(int dbtype,char* val) +{ + url_t* u=NULL; + url_t** conf_db_url; + + error(255,"do_dbdef (%i) called with (%s)\n",dbtype,val); + + switch(dbtype) { + case DB_OLD: { + conf_db_url=&(conf->db_in_url); + break; + } + case DB_WRITE: { + conf_db_url=&(conf->db_out_url); + break; + } + case DB_NEW: { + conf_db_url=&(conf->db_new_url); + break; + } + default : { + error(0,"Invalid call of do_dbdef\n"); + return; + } + } + + if(*conf_db_url==NULL){ + u=parse_url(val); + /* FIXME Check the URL if you add support for databases that cannot be + * both input and output urls */ + switch (dbtype) { + case DB_OLD: + case DB_NEW:{ + if(u==NULL||u->type==url_unknown||u->type==url_stdout + ||u->type==url_stderr) { + error(0,_("Unsupported input URL-type:%s\n"),val); + } + else { + *conf_db_url=u; + } + break; + } + case DB_WRITE: { + if(u==NULL||u->type==url_unknown||u->type==url_stdin){ + error(0,_("Unsupported output URL-type:%s\n"),val); + } + else{ + conf->db_out_url=u; + error(200,_("Output database set to \"%s\" \"%s\"\n"),val,u->value); + } + break; + } + } + } + free(val); +} + +void do_dbindef(char* val) +{ + url_t* u=NULL; + + if(conf->db_in_url==NULL){ + u=parse_url(val); + /* FIXME Check the URL if you add support for databases that cannot be + * both input and output urls */ + if(u==NULL||u->type==url_unknown||u->type==url_stdout + ||u->type==url_stderr) { + error(0,_("Unsupported input URL-type:%s\n"),val); + } + else { + conf->db_in_url=u; + } + } + + free(val); +} + +void do_dboutdef(char* val) +{ + url_t* u=NULL; + + error(200,_("Setting output database \"%s\"\n"),val); + + if(conf->db_out_url==NULL){ + u=parse_url(val); + /* FIXME Check the URL if you add support for databases that cannot be + * both input and output urls */ + if(u==NULL||u->type==url_unknown||u->type==url_stdin){ + error(0,_("Unsupported output URL-type:%s\n"),val); + } + else{ + conf->db_out_url=u; + error(200,_("Output database set to \"%s\" \"%s\"\n"),val,u->value); + } + } else { + error(200,_("Output database already set\n")); + } + + free(val); +} + +void do_repurldef(char* val) +{ + url_t* u=NULL; + + + u=parse_url(val); + /* FIXME Check the URL if you add support for databases that cannot be + * both input and output urls */ + if(u==NULL||u->type==url_unknown||u->type==url_stdin){ + error(0,_("Unsupported output URL-type:%s\n"),val); + } else { + error_init(u,0); + } + +} + +void do_verbdef(char* val) +{ + char* err=NULL; + long a=0; + + a=strtol(val,&err,10); + if(*err!='\0' || a>255 || a<0 || errno==ERANGE){ + error(0, _("Illegal verbosity level:%s\n"),val); + error(10,_("Using previous value:%i\n"),conf->verbose_level); + return; + } + else { + if(conf->verbose_level==-1){ + conf->verbose_level=a; + }else { + error(210,_("Verbosity already defined to %i\n"),conf->verbose_level); + } + } +} + +void do_rootprefix(char* val) { + if (conf->root_prefix_length == 0) { + conf->root_prefix=val; + conf->root_prefix_length=strlen(conf->root_prefix); + if (conf->root_prefix_length && conf->root_prefix[conf->root_prefix_length-1] == '/') { + conf->root_prefix[--conf->root_prefix_length] = '\0'; + error(200,_("Removed trailing '/' from root prefix \n")); + } + error(200,_("Root prefix set to '%s'\n"), conf->root_prefix); + } else { + error(200,_("Root prefix already set to '%s'\n"), conf->root_prefix); + } +} + +#ifdef WITH_E2FSATTRS +#define easy_e2fsattrs_case(c,f) \ +case c: { \ + conf->report_ignore_e2fsattrs|=f; \ + break; \ +} + +void do_report_ignore_e2fsattrs(char* val) { + conf->report_ignore_e2fsattrs = 0UL; + while (*val) { + switch(*val){ + /* source for mappings see compare_db.c */ + easy_e2fsattrs_case('s',EXT2_SECRM_FL) + easy_e2fsattrs_case('u',EXT2_UNRM_FL) + easy_e2fsattrs_case('S',EXT2_SYNC_FL) + easy_e2fsattrs_case('D',EXT2_DIRSYNC_FL) + easy_e2fsattrs_case('i',EXT2_IMMUTABLE_FL) + easy_e2fsattrs_case('a',EXT2_APPEND_FL) + easy_e2fsattrs_case('d',EXT2_NODUMP_FL) + easy_e2fsattrs_case('A',EXT2_NOATIME_FL) + easy_e2fsattrs_case('c',EXT2_COMPR_FL) + easy_e2fsattrs_case('B',EXT2_COMPRBLK_FL) + easy_e2fsattrs_case('Z',EXT2_DIRTY_FL) + easy_e2fsattrs_case('X',EXT2_NOCOMPR_FL) +#ifdef EXT2_ECOMPR_FL + easy_e2fsattrs_case('E',EXT2_ECOMPR_FL) +#else + easy_e2fsattrs_case('E',EXT4_ENCRYPT_FL) +#endif + easy_e2fsattrs_case('j',EXT3_JOURNAL_DATA_FL) + easy_e2fsattrs_case('I',EXT2_INDEX_FL) + easy_e2fsattrs_case('t',EXT2_NOTAIL_FL) + easy_e2fsattrs_case('T',EXT2_TOPDIR_FL) +#ifdef EXT4_EXTENTS_FL + easy_e2fsattrs_case('e',EXT4_EXTENTS_FL) +#endif +#ifdef EXT4_HUGE_FILE_FL + easy_e2fsattrs_case('h',EXT4_HUGE_FILE_FL) +#endif +#ifdef FS_NOCOW_FL + easy_e2fsattrs_case('C',FS_NOCOW_FL) +#endif +#ifdef EXT4_INLINE_DATA_FL + easy_e2fsattrs_case('N',EXT4_INLINE_DATA_FL) +#endif + case '0': { + break; + } + default: { + error(0,_("Ignore invalid ext2 file attribute: '%c'\n"),*val); + break; + } + } + *val++; + } +} +#endif + +const char* aide_key_7=CONFHMACKEY_07; +const char* db_key_7=DBHMACKEY_07; + +void* get_conf_key(void) { + void* r; + char* m=(char*)malloc(strlen(aide_key_1)+ + strlen(aide_key_2)+ + strlen(aide_key_3)+ + strlen(aide_key_4)+ + strlen(aide_key_5)+ + strlen(aide_key_6)+ + strlen(aide_key_7)+ + strlen(aide_key_8)+ + strlen(aide_key_9)+ + strlen(aide_key_0)+1); + m[0]=0; + strcat(m,aide_key_0); + strcat(m,aide_key_1); + strcat(m,aide_key_2); + strcat(m,aide_key_3); + strcat(m,aide_key_4); + strcat(m,aide_key_5); + strcat(m,aide_key_6); + strcat(m,aide_key_7); + strcat(m,aide_key_8); + strcat(m,aide_key_9); + + r=decode_base64(m,strlen(m),NULL); + + memset(m,0,strlen(m)); + free(m); + return r; +} + +size_t get_conf_key_len(void) { + size_t len=0; + char* m=(char*)malloc(strlen(aide_key_1)+ + strlen(aide_key_2)+ + strlen(aide_key_3)+ + strlen(aide_key_4)+ + strlen(aide_key_5)+ + strlen(aide_key_6)+ + strlen(aide_key_7)+ + strlen(aide_key_8)+ + strlen(aide_key_9)+ + strlen(aide_key_0)+1); + m[0]=0; + strcat(m,aide_key_0); + strcat(m,aide_key_1); + strcat(m,aide_key_2); + strcat(m,aide_key_3); + strcat(m,aide_key_4); + strcat(m,aide_key_5); + strcat(m,aide_key_6); + strcat(m,aide_key_7); + strcat(m,aide_key_8); + strcat(m,aide_key_9); + + len=length_base64(m,strlen(m)); + + memset(m,0,strlen(m)); + free(m); + return len; +} + +void* get_db_key(void) { + void* r; + char* m=(char*)malloc(strlen(db_key_1)+ + strlen(db_key_2)+ + strlen(db_key_3)+ + strlen(db_key_4)+ + strlen(db_key_5)+ + strlen(db_key_6)+ + strlen(db_key_7)+ + strlen(db_key_8)+ + strlen(db_key_9)+ + strlen(db_key_0)+1); + m[0]=0; + strcat(m,db_key_0); + strcat(m,db_key_1); + strcat(m,db_key_2); + strcat(m,db_key_3); + strcat(m,db_key_4); + strcat(m,db_key_5); + strcat(m,db_key_6); + strcat(m,db_key_7); + strcat(m,db_key_8); + strcat(m,db_key_9); + + r=decode_base64(m,strlen(m),NULL); + + memset(m,0,strlen(m)); + free(m); + return r; +} + +size_t get_db_key_len(void) { + size_t len=0; + char* m=(char*)malloc(strlen(db_key_1)+ + strlen(db_key_2)+ + strlen(db_key_3)+ + strlen(db_key_4)+ + strlen(db_key_5)+ + strlen(db_key_6)+ + strlen(db_key_7)+ + strlen(db_key_8)+ + strlen(db_key_9)+ + strlen(db_key_0)+1); + m[0]=0; + strcat(m,db_key_0); + strcat(m,db_key_1); + strcat(m,db_key_2); + strcat(m,db_key_3); + strcat(m,db_key_4); + strcat(m,db_key_5); + strcat(m,db_key_6); + strcat(m,db_key_7); + strcat(m,db_key_8); + strcat(m,db_key_9); + + len=length_base64(m,strlen(m)); + + memset(m,0,strlen(m)); + free(m); + return len; +} diff --git a/src/compare_db.c b/src/compare_db.c new file mode 100644 index 0000000..45b6f29 --- /dev/null +++ b/src/compare_db.c @@ -0,0 +1,791 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2007,2010-2013,2015,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Mike Markley, Hannes von Haugwitz + * $Id$ + * + * 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 "aide.h" +#include +#include +#include +#include +#include +#ifdef WITH_AUDIT +#include +#ifdef HAVE_SYSLOG +#include +#endif +#endif + +#include "base64.h" +#include "report.h" +#include "db_config.h" +#include "gen_list.h" +#include "list.h" +#include "db.h" +#include "util.h" +#include "commandconf.h" +#include "gen_list.h" +#include "compare_db.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#include "md.h" + +/*************/ +/* construction area for report lines */ + +const int width_details = 80; + +const char time_format[] = "%Y-%m-%d %H:%M:%S %z"; +const int time_string_len = 26; + +long ntotal, nadd, nrem, nchg = 0; + +const char* report_top_format = "\n\n---------------------------------------------------\n%s:\n---------------------------------------------------\n"; + +DB_ATTR_TYPE ignored_added_attrs, ignored_removed_attrs, ignored_changed_attrs, forced_attrs; + +const DB_ATTR_TYPE summary_attributes[] = { DB_FTYPE, DB_LINKNAME, DB_SIZE|DB_SIZEG, DB_BCOUNT, DB_PERM, DB_UID, DB_GID, DB_ATIME, DB_MTIME, DB_CTIME, DB_INODE, DB_LNKCOUNT, DB_HASHES +#ifdef WITH_ACL + , DB_ACL +#endif +#ifdef WITH_XATTR + , DB_XATTRS +#endif +#ifdef WITH_SELINUX + , DB_SELINUX +#endif +#ifdef WITH_E2FSATTRS + , DB_E2FSATTRS +#endif +}; + +const char summary_char[] = { '!' ,'l', '>', 'b', 'p', 'u', 'g', 'a', 'm', 'c', 'i', 'n', 'C' +#ifdef WITH_ACL + , 'A' +#endif +#ifdef WITH_XATTR + , 'X' +#endif +#ifdef WITH_SELINUX + , 'S' +#endif +#ifdef WITH_E2FSATTRS + , 'E' +#endif +}; + +const DB_ATTR_TYPE details_attributes[] = { DB_FTYPE, DB_LINKNAME, DB_SIZE, DB_SIZEG, DB_BCOUNT, DB_PERM, DB_UID, DB_GID, DB_ATIME, DB_MTIME, DB_CTIME, DB_INODE, DB_LNKCOUNT, DB_MD5, DB_SHA1, DB_RMD160, DB_TIGER, DB_SHA256, DB_SHA512 +#ifdef WITH_MHASH + , DB_CRC32, DB_HAVAL, DB_GOST, DB_CRC32B, DB_WHIRLPOOL +#endif +#ifdef WITH_ACL + , DB_ACL +#endif +#ifdef WITH_XATTR + , DB_XATTRS +#endif +#ifdef WITH_SELINUX + , DB_SELINUX +#endif +#ifdef WITH_E2FSATTRS + , DB_E2FSATTRS +#endif +}; + +const char* details_string[] = { _("File type") , _("Lname"), _("Size"), _("Size (>)"), _("Bcount"), _("Perm"), _("Uid"), _("Gid"), _("Atime"), _("Mtime"), _("Ctime"), _("Inode"), _("Linkcount"), _("MD5"), _("SHA1"), _("RMD160"), _("TIGER"), _("SHA256"), _("SHA512") +#ifdef WITH_MHASH + , _("CRC32"), _("HAVAL"), _("GOST"), _("CRC32B"), _("WHIRLPOOL") +#endif +#ifdef WITH_ACL + , _("ACL") +#endif +#ifdef WITH_XATTR + , _("XAttrs") +#endif +#ifdef WITH_SELINUX + , _("SELinux") +#endif +#ifdef WITH_E2FSATTRS + , _("E2FSAttrs") +#endif +}; + +const char* attrs_string[] = { "filename", "l", "p", "u", "g", "s", "a", "c", "m", "i", "b", "n", + "md5", "sha1", "rmd160", "tiger", "crc32", "haval", "gost", "crc32b", + "attr", "acl", "bsize", "rdev", "dev", "checkmask", "S", "I", "ANF", + "ARF", "sha256", "sha512", "selinux", "xattrs", "whirlpool", "ftype", + "e2fsattrs" }; + +#ifdef WITH_E2FSATTRS + /* flag->character mappings taken from lib/e2p/pf.c (git commit c46b57b) + * date: 2015-05-10 + * sources: git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git + * + * on update see also do_e2fsattrs in commandconf.c + */ + unsigned long flag_bits[] = { EXT2_SECRM_FL, EXT2_UNRM_FL, EXT2_SYNC_FL, EXT2_DIRSYNC_FL, EXT2_IMMUTABLE_FL, + EXT2_APPEND_FL, EXT2_NODUMP_FL, EXT2_NOATIME_FL, EXT2_COMPR_FL, EXT2_COMPRBLK_FL, + EXT2_DIRTY_FL, EXT2_NOCOMPR_FL, +#ifdef EXT2_ECOMPR_FL + EXT2_ECOMPR_FL, +#else + EXT4_ENCRYPT_FL, +#endif + EXT3_JOURNAL_DATA_FL, EXT2_INDEX_FL, + EXT2_NOTAIL_FL, EXT2_TOPDIR_FL +#ifdef EXT4_EXTENTS_FL + , EXT4_EXTENTS_FL +#endif +#ifdef EXT4_HUGE_FILE_FL + , EXT4_HUGE_FILE_FL +#endif +#ifdef FS_NOCOW_FL + , FS_NOCOW_FL +#endif +#ifdef EXT4_INLINE_DATA_FL + , EXT4_INLINE_DATA_FL +#endif + + }; + char flag_char[] = { 's', 'u', 'S', 'D', 'i', 'a', 'd', 'A', 'c', 'B', 'Z', 'X', 'E', 'j', 'I', 't', 'T' +#ifdef EXT4_EXTENTS_FL + , 'e' +#endif +#ifdef EXT4_HUGE_FILE_FL + , 'h' +#endif +#ifdef FS_NOCOW_FL + , 'C' +#endif +#ifdef EXT4_INLINE_DATA_FL + , 'N' +#endif + }; +/*************/ +#endif + +static DB_ATTR_TYPE get_special_report_group(char* group) { + DB_ATTR_TYPE attr = get_groupval(group); + return attr==DB_ATTR_UNDEF?0:attr; +} + +static char* report_attrs(DB_ATTR_TYPE attrs) { + char* str; + int j = 1; + int num_attrs = sizeof(attrs_string)/sizeof(char*); + for (int i = 0; i < num_attrs; ++i) { + if ((1LLU<()!@#$%^&*|\\/?~" + +static int xattrs2array(xattrs_type* xattrs, char* **values) { + int n = 0; + if (xattrs==NULL) { n=1; } + else { n=1+xattrs->num; } + *values = malloc(n * sizeof(char*)); + (*values)[0]=malloc((6+floor(log10(n)))*sizeof(char)); + snprintf((*values)[0], 6+floor(log10(n)), "num=%d", n-1); + if (n>1) { + size_t num = 0; + int width, length; + width = log10(xattrs->num); /* make them the same width */ + while (num++ < xattrs->num) { + char *val = NULL; + size_t len = 0; + val = (char *)xattrs->ents[num - 1].val; + len = xstrnspn(val, xattrs->ents[num - 1].vsz, PRINTABLE_XATTR_VALS); + if ((len == xattrs->ents[num - 1].vsz) || ((len == (xattrs->ents[num - 1].vsz - 1)) && !val[len])) { + length = 8 + width + strlen(xattrs->ents[num - 1].key) + strlen(val); + (*values)[num]=malloc(length *sizeof(char)); + snprintf((*values)[num], length , "[%.*zd] %s = %s", width, num, xattrs->ents[num - 1].key, val); + } else { + val = encode_base64(xattrs->ents[num - 1].val, xattrs->ents[num - 1].vsz); + length = 10 + width + strlen(xattrs->ents[num - 1].key) + strlen(val); + (*values)[num]=malloc( length *sizeof(char)); + snprintf((*values)[num], length , "[%.*zd] %s <=> %s", width, num, xattrs->ents[num - 1].key, val); + free(val); + } + } + } + return n; +} +#endif + +#ifdef WITH_ACL +static int acl2array(acl_type* acl, char* **values) { + int n = 0; +#ifdef WITH_POSIX_ACL +#define easy_posix_acl(x,y) \ + if (acl->x) { \ + i = k = 0; \ + while (acl->x[i]) { \ + if (acl->x[i]=='\n') { \ + (*values)[j]=malloc(4+(i-k)*sizeof(char)); \ + snprintf((*values)[j], 4+(i-k), "%c: %s", y, &acl->x[k]); \ + j++; \ + k=i+1; \ + } \ + i++; \ + } \ + } + if (acl->acl_a || acl->acl_d) { + int j, k, i; + if (acl->acl_a) { i = 0; while (acl->acl_a[i]) { if (acl->acl_a[i++]=='\n') { n++; } } } + if (acl->acl_d) { i = 0; while (acl->acl_d[i]) { if (acl->acl_d[i++]=='\n') { n++; } } } + *values = malloc(n * sizeof(char*)); + j = 0; + easy_posix_acl(acl_a, 'A') + easy_posix_acl(acl_d, 'D') + } +#endif +#ifdef WITH_SUN_ACL +/* FIXME: readd sun acl support */ +#endif + return n; +} +#endif + +#ifdef WITH_E2FSATTRS +static char* e2fsattrs2string(unsigned long flags, int flags_only) { + int length = sizeof(flag_bits)/sizeof(long); + char* string = malloc ((length+1) * sizeof (char)); + int j = 0; + for (int i = 0 ; i < length ; i++) { + if (!flags_only && flag_bits[i]&(conf->report_ignore_e2fsattrs)) { + string[j++]=':'; + } else if (flag_bits[i] & flags) { + string[j++]=flag_char[i]; + } else if (!flags_only) { + string[j++]='-'; + } + } + string[j] = '\0'; + return string; +} +#endif + +static char* get_file_type_string(mode_t mode) { + switch (mode & S_IFMT) { + case S_IFREG: return _("File"); + case S_IFDIR: return _("Directory"); +#ifdef S_IFIFO + case S_IFIFO: return _("FIFO"); +#endif + case S_IFLNK: return _("Link"); + case S_IFBLK: return _("Block device"); + case S_IFCHR: return _("Character device"); +#ifdef S_IFSOCK + case S_IFSOCK: return _("Socket"); +#endif +#ifdef S_IFDOOR + case S_IFDOOR: return _("Door"); +#endif +#ifdef S_IFPORT + case S_IFPORT: return _("Port"); +#endif + case 0: return NULL; + default: return _("Unknown file type"); + } +} + +static char* byte_to_base16(byte* src, size_t ssize) { + char* str = malloc((2*ssize+1) * sizeof (char)); + size_t i; + for(i=0; i < ssize; ++i) { + snprintf(&str[2*i], 3, "%02x", src[i]); + } + return str; +} + +static int get_attribute_values(DB_ATTR_TYPE attr, db_line* line, + char* **values) { + +#define easy_string(s) \ +l = strlen(s)+1; \ +*values[0] = malloc(l * sizeof (char)); \ +snprintf(*values[0], l, "%s",s); + +#define easy_md(a,b,c) \ +} else if (a&attr) { \ + if (conf->report_base16) { \ + *values[0] = byte_to_base16(line->b, c); \ + } else { \ + *values[0] = encode_base64(line->b, c); \ + } + +#define easy_number(a,b,c) \ +} else if (a&attr) { \ + l = 2+floor(line->b?log10(line->b):0); \ + *values[0] = malloc(l * sizeof (char)); \ + snprintf(*values[0], l, c,line->b); + +#define easy_time(a,b) \ +} else if (a&attr) { \ + *values[0] = malloc(time_string_len * sizeof (char)); \ + strftime(*values[0], time_string_len, time_format, localtime(&(line->b))); + + int l; + if (line==NULL || !(line->attr&attr)) { + *values = NULL; + return 0; +#ifdef WITH_ACL + } else if (DB_ACL&attr) { + return acl2array(line->acl, &*values); +#endif +#ifdef WITH_XATTR + } else if (DB_XATTRS&attr) { + return xattrs2array(line->xattrs, &*values); +#endif + } else { + *values = malloc(1 * sizeof (char*)); + if (DB_FTYPE&attr) { + easy_string(get_file_type_string(line->perm)) + } else if (DB_LINKNAME&attr) { + easy_string(line->linkname) + easy_number((DB_SIZE|DB_SIZEG),size,"%li") + } else if (DB_PERM&attr) { + *values[0] = perm_to_char(line->perm); + easy_time(DB_ATIME,atime) + easy_time(DB_MTIME,mtime) + easy_time(DB_CTIME,ctime) + easy_number(DB_BCOUNT,bcount,"%li") + easy_number(DB_UID,uid,"%i") + easy_number(DB_GID,gid,"%i") + easy_number(DB_INODE,inode,"%lu") + easy_number(DB_LNKCOUNT,nlink,"%lu") + easy_md(DB_MD5,md5,HASH_MD5_LEN) + easy_md(DB_SHA1,sha1,HASH_SHA1_LEN) + easy_md(DB_RMD160,rmd160,HASH_RMD160_LEN) + easy_md(DB_TIGER,tiger,HASH_TIGER_LEN) + easy_md(DB_SHA256,sha256,HASH_SHA256_LEN) + easy_md(DB_SHA512,sha512,HASH_SHA512_LEN) +#ifdef WITH_MHASH + easy_md(DB_CRC32,crc32,HASH_CRC32_LEN) + easy_md(DB_HAVAL,haval,HASH_HAVAL256_LEN) + easy_md(DB_GOST,gost,HASH_GOST_LEN) + easy_md(DB_CRC32B,crc32b,HASH_CRC32B_LEN) + easy_md(DB_WHIRLPOOL,whirlpool,HASH_WHIRLPOOL_LEN) +#endif +#ifdef WITH_SELINUX + } else if (DB_SELINUX&attr) { + easy_string(line->cntx) +#endif +#ifdef WITH_E2FSATTRS + } else if (DB_E2FSATTRS&attr) { + *values[0]=e2fsattrs2string(line->e2fsattrs, 0); +#endif + } else { + easy_string("unknown attribute") + } + return 1; + } +} + +static void print_line(seltree* node) { + if(conf->summarize_changes==1) { + int i; + int length = sizeof(summary_attributes)/sizeof(DB_ATTR_TYPE); + char* summary = malloc ((length+1) * sizeof (char)); + if (node->checked&(NODE_ADDED|NODE_REMOVED)) { + summary[0]=get_file_type_char((node->checked&NODE_REMOVED?node->old_data:node->new_data)->perm); + for(i=1;ichecked&NODE_ADDED?'+':'-'; + } + } else if (node->checked&NODE_CHANGED) { + char c, u, a, r, g, s; + for(i=0;inew_data)->perm); + continue; + case 2: + if (summary_attributes[i]&(node->changed_attrs&(~ignored_changed_attrs)) && (node->old_data)->size > (node->new_data)->size) { + c = '<'; + } + u = '='; + break; + } + if (summary_attributes[i]&node->changed_attrs&(forced_attrs|(~ignored_changed_attrs))) { + summary[i]=c; + } else if (summary_attributes[i]&((node->old_data)->attr&~((node->new_data)->attr)&(forced_attrs|~(ignored_removed_attrs)))) { + summary[i]=r; + } else if (summary_attributes[i]&~((node->old_data)->attr)&(node->new_data)->attr&(forced_attrs|~(ignored_added_attrs))) { + summary[i]=a; + } else if (summary_attributes[i]& ( + (((node->old_data)->attr&~((node->new_data)->attr)&ignored_removed_attrs))| + (~((node->old_data)->attr)&(node->new_data)->attr&ignored_added_attrs)| + (((node->old_data)->attr&(node->new_data)->attr)&ignored_changed_attrs) + ) ) { + summary[i]=g; + } else if (summary_attributes[i]&((node->old_data)->attr&(node->new_data)->attr)) { + summary[i]=u; + } else { + summary[i]=s; + } + } + } + summary[length]='\0'; + error(2,"\n%s: %s", summary, (node->checked&NODE_REMOVED?node->old_data:node->new_data)->filename); + free(summary); summary=NULL; + } else { + if (node->checked&NODE_ADDED) { + error(2,"added: %s\n",(node->new_data)->filename); + } else if (node->checked&NODE_REMOVED) { + error(2,"removed: %s\n",(node->old_data)->filename); + } else if (node->checked&NODE_CHANGED) { + error(2,"changed: %s\n",(node->new_data)->filename); + } + } +} + +static void print_dbline_attributes(db_line* oline, db_line* nline, DB_ATTR_TYPE + changed_attrs, DB_ATTR_TYPE force_attrs) { + char **ovalue, **nvalue; + int onumber, nnumber, olen, nlen, i, j, k, c; + int length = sizeof(details_attributes)/sizeof(DB_ATTR_TYPE); + int p = (width_details-(width_details%2?13:14))/2; + DB_ATTR_TYPE attrs; + error(2,"\n"); + char *file_type = get_file_type_string((nline==NULL?oline:nline)->perm); + if (file_type) { + error(2,"%s: ", file_type); + } + error(2,"%s\n", (nline==NULL?oline:nline)->filename); + attrs=force_attrs|(~(ignored_changed_attrs)&changed_attrs); + for (j=0; j < length; ++j) { + if (details_attributes[j]&attrs) { + onumber=get_attribute_values(details_attributes[j], oline, &ovalue); + nnumber=get_attribute_values(details_attributes[j], nline, &nvalue); + i = 0; + while (i= 0 || nlen-p*k >= 0) { + c = k*(p-1); + if (!onumber) { + error(2," %s%-9s%c %-*c %.*s\n", width_details%2?"":" ", i+k?"":details_string[j], i+k?' ':':', p, ' ', p-1, nlen-c>0?&nvalue[i][c]:""); + } else if (!nnumber) { + error(2," %s%-9s%c %.*s\n", width_details%2?"":" ", i+k?"":details_string[j], i+k?' ':':', p-1, olen-c>0?&ovalue[i][c]:""); + } else { + error(2," %s%-9s%c %-*.*s| %.*s\n", width_details%2?"":" ", i+k?"":details_string[j], i+k?' ':':', p, p-1, olen-c>0?&ovalue[i][c]:"", p-1, nlen-c>0?&nvalue[i][c]:""); + } + k++; + } + ++i; + } + for(i=0; i < onumber; ++i) { free(ovalue[i]); ovalue[i]=NULL; } free(ovalue); ovalue=NULL; + for(i=0; i < nnumber; ++i) { free(nvalue[i]); nvalue[i]=NULL; } free(nvalue); nvalue=NULL; + } + } +} + +static void print_attributes_added_node(db_line* line) { + print_dbline_attributes(NULL, line, 0, line->attr); +} + +static void print_attributes_removed_node(db_line* line) { + print_dbline_attributes(line, NULL, 0, line->attr); +} + +static void terse_report(seltree* node) { + list* r=NULL; + if ((node->checked&(DB_OLD|DB_NEW)) != 0) { + ntotal += ((node->checked&DB_NEW) != 0); + if (!(node->checked&DB_OLD)){ + /* File is in new db but not old. (ADDED) */ + /* unless it was moved in */ + if (!((node->checked&NODE_ALLOW_NEW)||(node->checked&NODE_MOVED_IN))) { + nadd++; + node->checked|=NODE_ADDED; + } + } else if (!(node->checked&DB_NEW)){ + /* File is in old db but not new. (REMOVED) */ + /* unless it was moved out */ + if (!((node->checked&NODE_ALLOW_RM)||(node->checked&NODE_MOVED_OUT))) { + nrem++; + node->checked|=NODE_REMOVED; + } + } else if ((node->old_data!=NULL)&&(node->new_data!=NULL)){ + /* File is in both db's and the data is still there. (CHANGED) */ + if (!(node->checked&(NODE_MOVED_IN|NODE_MOVED_OUT))){ + nchg++; + node->checked|=NODE_CHANGED; + }else if (!((node->checked&NODE_ALLOW_NEW)||(node->checked&NODE_MOVED_IN))) { + nadd++; + node->checked|=NODE_ADDED; + }else if (!((node->checked&NODE_ALLOW_RM)||(node->checked&NODE_MOVED_OUT))) { + nrem++; + node->checked|=NODE_REMOVED; + } + } + } + for (r=node->childs;r;r=r->next) { + terse_report((seltree*)r->data); + } +} + +static void print_report_list(seltree* node, const int node_status) { + list* r=NULL; + if (node->checked&node_status) { + print_line(node); + } + for(r=node->childs;r;r=r->next){ + print_report_list((seltree*)r->data, node_status); + } +} + +static void print_report_details(seltree* node) { + list* r=NULL; + if (conf->verbose_level>=5) { + if (node->checked&NODE_CHANGED) { + print_dbline_attributes(node->old_data, node->new_data, node->changed_attrs, (conf->verbose_level>=6?( + ((node->old_data)->attr&~((node->new_data)->attr)&~(ignored_removed_attrs))|(~((node->old_data)->attr)&(node->new_data)->attr&~(ignored_added_attrs)) + ):0)|forced_attrs); + } else if ((conf->verbose_level>=7)) { + if (node->checked&NODE_ADDED) { print_attributes_added_node(node->new_data); } + if (node->checked&NODE_REMOVED) { print_attributes_removed_node(node->old_data); } + } + } + for(r=node->childs;r;r=r->next){ + print_report_details((seltree*)r->data); + } +} + +static void print_report_header() { + char *time; + int first = 1; + + time = malloc(time_string_len * sizeof (char)); + strftime(time, time_string_len, time_format, localtime(&(conf->start_time))); + error(2,_("Start timestamp: %s (AIDE " AIDEVERSION ")\n"), time); + free(time); time=NULL; + + error(0,_("AIDE")); + if(conf->action&(DO_COMPARE|DO_DIFF)) { + error(0,_(" found %sdifferences between %s%s!!\n"), (nadd||nrem||nchg)?"":"NO ", conf->action&DO_COMPARE?_("database and filesystem"):_("the two databases"), (nadd||nrem||nchg)?"":_(". Looks okay")); + if(conf->action&(DO_INIT)) { + error(0,_("New AIDE database written to %s\n"),conf->db_out_url->value); + } + } else { + error(0,_(" initialized database at %s\n"),conf->db_out_url->value); + } + + if(conf->config_version) + error(2,_("Config version used: %s\n"),conf->config_version); + + if (conf->limit != NULL) { + error (2,_("Limit: %s"), conf->limit); + first = 0; + } + if (conf->action&(DO_INIT|DO_COMPARE) && conf->root_prefix_length > 0) { + if (first) { first=0; } + else { error (2," | "); } + error (2,_("Root prefix: %s"),conf->root_prefix); + } + if (conf->verbose_level != 5) { + if (first) { first=0; } + else { error (2," | "); } + error (2,_("Verbose level: %d"), conf->verbose_level); + } + if (!first) { error (2,"\n"); } + if (ignored_added_attrs) { + error (2,_("Ignored added attributes: %s\n"),report_attrs(ignored_added_attrs)); + } + if (ignored_removed_attrs) { + error (2,_("Ignored removed attributes: %s\n"),report_attrs(ignored_removed_attrs)); + } + if (ignored_changed_attrs) { + error (2,_("Ignored changed attributes: %s\n"),report_attrs(ignored_changed_attrs)); + } + if (forced_attrs) { + error (2,_("Forced attributes: %s\n"),report_attrs(forced_attrs)); + } +#ifdef WITH_E2FSATTRS + if (conf->report_ignore_e2fsattrs) { + error (2,_("Ignored e2fs attributes: %s\n"), e2fsattrs2string(conf->report_ignore_e2fsattrs, 1) ); + } +#endif + + if(conf->action&(DO_COMPARE|DO_DIFF) && (nadd||nrem||nchg)) { + error(0,_("\nSummary:\n Total number of entries:\t%li\n Added entries:\t\t%li\n" + " Removed entries:\t\t%li\n Changed entries:\t\t%li"), ntotal, nadd, nrem, nchg); + } else { + error(0,_("\nNumber of entries:\t%li"), ntotal); + } +} + +static void print_report_databases() { + if (conf->verbose_level>=2 && (conf->line_db_in || conf->line_db_out)) { + error(2,(char*)report_top_format,_("The attributes of the (uncompressed) database(s)")); + if (conf->line_db_in) { + print_attributes_removed_node(conf->line_db_in); + } + if (conf->line_db_out) { + print_attributes_removed_node(conf->line_db_out); + } + } +} + +static void print_report_footer() +{ + char *time = malloc(time_string_len * sizeof (char)); + int run_time = (int) difftime(conf->end_time, conf->start_time); + + strftime(time, time_string_len, time_format, localtime(&(conf->end_time))); + error(2,_("\n\nEnd timestamp: %s (run time: %dm %ds)\n"), time, run_time/60, run_time%60); + free(time); time=NULL; +} + +#ifdef WITH_AUDIT + /* Something changed, send audit anomaly message */ +void send_audit_report() +{ + if(nadd!=0||nrem!=0||nchg!=0){ + int fd=audit_open(); + if (fd>=0){ + char msg[64]; + + snprintf(msg, sizeof(msg), "added=%ld removed=%ld changed=%ld", + nadd, nrem, nchg); + + if (audit_log_user_message(fd, AUDIT_ANOM_RBAC_INTEGRITY_FAIL, + msg, NULL, NULL, NULL, 0)<=0) +#ifdef HAVE_SYSLOG + syslog(LOG_ERR, "Failed sending audit message:%s", msg); +#else + ; +#endif + close(fd); + } + } +} +#endif /* WITH_AUDIT */ + +int gen_report(seltree* node) { + forced_attrs = get_special_report_group("report_force_attrs"); + ignored_added_attrs = get_special_report_group("report_ignore_added_attrs"); + ignored_removed_attrs = get_special_report_group("report_ignore_removed_attrs"); + ignored_changed_attrs = get_special_report_group("report_ignore_changed_attrs"); + + terse_report(node); +#ifdef WITH_AUDIT + send_audit_report(); +#endif + if ((nadd|nrem|nchg) > 0 || conf->report_quiet == 0) { + print_report_header(); + if(conf->action&(DO_COMPARE|DO_DIFF) || (conf->action&DO_INIT && conf->report_detailed_init) ) { + if (conf->grouped) { + if (nadd) { + error(2,(char*)report_top_format,_("Added entries")); + print_report_list(node, NODE_ADDED); + } + if (nrem) { + error(2,(char*)report_top_format,_("Removed entries")); + print_report_list(node, NODE_REMOVED); + } + if (nchg) { + error(2,(char*)report_top_format,_("Changed entries")); + print_report_list(node, NODE_CHANGED); + } + } else if (nadd || nrem || nchg) { + if (nadd && nrem && nchg) { error(2,(char*)report_top_format,_("Added, removed and changed entries")); } + else if (nadd && nrem) { error(2,(char*)report_top_format,_("Added and removed entries")); } + else if (nadd && nchg) { error(2,(char*)report_top_format,_("Added and changed entries")); } + else if (nrem && nchg) { error(2,(char*)report_top_format,_("Removed and changed entries")); } + else if (nadd) { error(2,(char*)report_top_format,_("Added entries")); } + else if (nrem) { error(2,(char*)report_top_format,_("Removed entries")); } + else if (nchg) { error(2,(char*)report_top_format,_("Changed entries")); } + print_report_list(node, NODE_ADDED|NODE_REMOVED|NODE_CHANGED); + } + if (nadd || nrem || nchg) { + error(nchg?5:7,(char*)report_top_format,_("Detailed information about changes")); + print_report_details(node); + } + } + print_report_databases(); + conf->end_time=time(&(conf->end_time)); + print_report_footer(); + } + + return conf->action&(DO_COMPARE|DO_DIFF) ? (nadd!=0)*1+(nrem!=0)*2+(nchg!=0)*4 : 0; +} + +const char* aide_key_9=CONFHMACKEY_09; +const char* db_key_9=DBHMACKEY_09; + +// vi: ts=8 sw=8 diff --git a/src/conf_lex.c b/src/conf_lex.c new file mode 100644 index 0000000..1147700 --- /dev/null +++ b/src/conf_lex.c @@ -0,0 +1,7317 @@ +#line 2 "src/conf_lex.c" + +#line 4 "src/conf_lex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer conf_create_buffer +#define yy_delete_buffer conf_delete_buffer +#define yy_flex_debug conf_flex_debug +#define yy_init_buffer conf_init_buffer +#define yy_flush_buffer conf_flush_buffer +#define yy_load_buffer_state conf_load_buffer_state +#define yy_switch_to_buffer conf_switch_to_buffer +#define yyin confin +#define yyleng confleng +#define yylex conflex +#define yylineno conflineno +#define yyout confout +#define yyrestart confrestart +#define yytext conftext +#define yywrap confwrap +#define yyalloc confalloc +#define yyrealloc confrealloc +#define yyfree conffree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 +#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 + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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 confrestart(confin ) + +#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 yy_size_t confleng; + +extern FILE *confin, *confout; + +#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 conftext. */ \ + 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 conftext 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. + */ + yy_size_t 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 confrestart()), so that the user can continue scanning by + * just pointing confin 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 = 0; /**< 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 conftext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t confleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow confwrap()'s to do buffer switches + * instead of setting up a fresh confin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void confrestart (FILE *input_file ); +void conf_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE conf_create_buffer (FILE *file,int size ); +void conf_delete_buffer (YY_BUFFER_STATE b ); +void conf_flush_buffer (YY_BUFFER_STATE b ); +void confpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void confpop_buffer_state (void ); + +static void confensure_buffer_stack (void ); +static void conf_load_buffer_state (void ); +static void conf_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER conf_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE conf_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE conf_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE conf_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *confalloc (yy_size_t ); +void *confrealloc (void *,yy_size_t ); +void conffree (void * ); + +#define yy_new_buffer conf_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + confensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + conf_create_buffer(confin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + confensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + conf_create_buffer(confin,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 unsigned char YY_CHAR; + +FILE *confin = (FILE *) 0, *confout = (FILE *) 0; + +typedef int yy_state_type; + +extern int conflineno; + +int conflineno = 1; + +extern char *conftext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr conftext + +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 ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up conftext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + confleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 59 +#define YY_END_OF_BUFFER 60 +/* 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 yyconst flex_int16_t yy_accept[2848] = + { 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, 60, 58, 32, 33, 1, 57, + 58, 32, 58, 1, 6, 4, 58, 58, 6, 6, + 6, 6, 6, 6, 6, 6, 32, 10, 9, 11, + 8, 12, 9, 9, 32, 6, 11, 8, 12, 6, + 9, 6, 6, 6, 6, 6, 6, 6, 6, 13, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 32, + 15, 14, 14, 32, 14, 14, 6, 4, 14, 14, + 6, 6, 6, 6, 6, 6, 6, 6, 23, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 31, 1, + 31, 31, 31, 1, 6, 4, 31, 31, 6, 6, + 6, 6, 6, 6, 6, 6, 32, 7, 32, 7, + 56, 56, 56, 56, 56, 56, 56, 56, 6, 4, + 56, 56, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 26, 26, 6, 26, 6, 6, + 6, 6, 6, 6, 6, 6, 49, 49, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 32, 1, + 57, 0, 0, 32, 0, 6, 4, 0, 0, 6, + 6, 6, 6, 6, 6, 6, 6, 5, 1, 1, + + 6, 4, 4, 4, 3, 0, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 32, 10, 9, 9, + 9, 9, 32, 6, 6, 9, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 9, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 13, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 32, + 15, 14, 14, 32, 14, 5, 14, 6, 4, 4, + 4, 3, 14, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 23, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 31, 1, 31, 31, 31, + + 5, 1, 1, 6, 4, 4, 4, 3, 31, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 32, + 7, 7, 32, 7, 7, 56, 56, 56, 55, 56, + 56, 56, 5, 56, 6, 4, 4, 4, 3, 56, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 26, 26, 6, 26, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 49, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 5, 5, 5, 1, 4, 4, 4, 4, + + 3, 3, 3, 0, 0, 0, 0, 0, 0, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 5, 5, 5, 14, 4, 4, 4, 4, + 3, 3, 3, 14, 14, 14, 14, 14, 14, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 31, 5, 5, 5, 1, 4, 4, 4, 4, + + 3, 3, 3, 31, 31, 31, 31, 31, 31, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 56, 56, 54, 5, 5, 5, 56, 4, 4, 4, + 4, 3, 3, 3, 56, 56, 56, 56, 56, 56, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 0, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, + 5, 5, 1, 4, 3, 3, 3, 3, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 5, 4, 3, 3, 3, 3, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 5, 5, 5, 1, 4, 3, 3, 3, + + 3, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 56, 5, 5, 5, 5, 4, 3, 3, 3, + 3, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 0, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 5, 1, 4, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 5, 4, 3, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 2, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 5, 1, 4, 3, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 2, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 5, 4, 3, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 2, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 1, 2, 3, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 2, 2, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 5, 2, 3, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 2, 2, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 5, 1, 2, 3, 31, 31, 31, 20, + 31, 31, 31, 31, 31, 31, 31, 31, 2, 2, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 5, 2, 3, 56, 56, 56, 20, 56, 56, + + 56, 56, 56, 56, 56, 56, 2, 2, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 0, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, + 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, + 21, 19, 0, 0, 0, 0, 17, 2, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 2, 2, 2, 2, 2, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 2, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 2, 1, 1, 2, 2, 2, 2, 31, 31, + 31, 31, 21, 19, 31, 31, 31, 31, 17, 2, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 2, 2, 2, 2, 2, 56, 56, 56, 56, + 21, 19, 56, 56, 56, 56, 17, 2, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, + 16, 0, 24, 18, 0, 0, 2, 6, 6, 6, + 0, 39, 6, 0, 52, 6, 6, 6, 6, 6, + 6, 6, 0, 42, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 14, 14, 14, 14, 14, 14, 14, 14, 2, 6, + 6, 6, 14, 6, 14, 6, 6, 6, 6, 6, + 6, 6, 14, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 2, 2, 2, 1, + 2, 2, 2, 2, 2, 2, 2, 31, 31, 16, + 31, 24, 18, 31, 31, 2, 6, 6, 6, 31, + 6, 31, 6, 6, 6, 6, 6, 6, 6, 31, + 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 56, 56, 16, 56, 24, 18, 56, 56, 2, + 6, 6, 6, 39, 6, 52, 6, 6, 6, 6, + 6, 6, 6, 42, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 2, 2, 2, 2, 1, 2, 2, 2, + 2, 2, 0, 0, 27, 0, 25, 30, 2, 6, + 6, 0, 34, 6, 39, 6, 52, 6, 6, 6, + 6, 6, 6, 6, 42, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 14, 14, 14, 14, 14, 14, 2, 6, 6, + 14, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 2, 2, 2, 2, 1, 2, 2, + 2, 2, 2, 31, 31, 27, 31, 25, 30, 2, + 6, 6, 31, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 56, 56, 27, 56, 25, 30, 2, 6, + 6, 34, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 2, 1, 2, + 2, 0, 22, 0, 2, 6, 6, 34, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 2, 2, 2, 14, 14, 14, 2, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 2, 1, 2, 2, 31, + 22, 31, 2, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, + 56, 22, 56, 2, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 2, 1, 2, 2, + 0, 0, 6, 6, 6, 6, 6, 6, 0, 50, + 6, 6, 6, 6, 0, 44, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, + 2, 2, 14, 14, 6, 6, 6, 6, 6, 6, + 14, 6, 6, 6, 6, 14, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 2, 1, 2, 2, 31, 31, 6, 6, + 6, 6, 6, 6, 31, 6, 6, 6, 6, 31, + 6, 6, 6, 2, 2, 2, 56, 56, 6, 6, + 6, 6, 6, 6, 50, 6, 6, 6, 6, 44, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, + 2, 0, 29, 6, 6, 6, 6, 6, 6, 50, + 6, 6, 6, 6, 44, 0, 51, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 2, 2, 14, 14, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 14, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 2, 2, 31, 29, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 31, + 6, 6, 2, 2, 56, 29, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 51, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 0, 6, 6, 6, 6, 0, 36, + 0, 35, 6, 6, 6, 0, 47, 51, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 14, 6, 6, 6, 6, 14, 14, 6, 6, 6, + 14, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 31, 6, 6, 6, 6, 31, 31, 6, + + 6, 6, 31, 6, 6, 56, 6, 6, 6, 6, + 36, 35, 6, 6, 6, 47, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 28, 6, 6, 6, + 6, 36, 35, 0, 46, 6, 6, 47, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 14, 6, 6, 6, 6, + 14, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 28, 6, 6, 6, 6, 31, 6, + + 6, 6, 6, 28, 6, 6, 6, 6, 46, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 53, 6, 0, 37, 46, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 14, 6, 14, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 31, 6, 31, 6, 6, + 6, 6, 6, 53, 6, 37, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 53, 6, 37, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 0, 40, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 14, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 31, 6, 6, 6, 6, 6, 40, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 40, 0, 38, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + + 6, 6, 6, 6, 14, 6, 6, 6, 6, 6, + 6, 6, 6, 31, 6, 6, 6, 6, 38, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 38, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 45, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 14, 6, 6, 6, 6, + 6, 6, 31, 6, 6, 6, 45, 6, 6, 6, + + 6, 6, 6, 6, 0, 41, 0, 43, 45, 6, + 6, 6, 6, 6, 6, 14, 14, 6, 6, 31, + 31, 6, 41, 43, 6, 6, 6, 41, 43, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, + 48, 6, 14, 31, 48, 48, 0 + } ; + +static yyconst 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, 5, 1, 6, 7, 8, 7, 7, 7, + 7, 7, 9, 10, 11, 7, 12, 13, 14, 15, + 16, 16, 16, 17, 16, 16, 16, 7, 7, 7, + 18, 19, 7, 20, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 7, 22, 7, 7, 23, 7, 24, 25, 26, 27, + + 28, 29, 30, 31, 32, 21, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 7, 50, 7, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 8, 8, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 8, 1, 1, 1, 1, 1, 8, + 1, 1, 8, 1, 1, 1, 1, 8, 8, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, + 1, 8, 1, 1, 1 + } ; + +static yyconst YY_CHAR yy_meta[51] = + { 0, + 1, 2, 3, 2, 4, 1, 4, 5, 4, 4, + 6, 4, 5, 5, 5, 5, 5, 4, 7, 4, + 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 4, 4 + } ; + +static yyconst flex_uint16_t yy_base[3227] = + { 0, + 0, 50, 100, 0, 150, 200, 250, 300, 350, 400, + 450, 500, 550, 600, 11, 12, 0, 0, 650, 700, + 750, 800, 850, 900,12111,17416, 19,17416, 0, 0, + 12083, 950, 5,12073, 1000, 122, 12,12066, 1050, 0, + 7, 87, 8, 1, 12, 15, 1099,17416, 117,17416, + 17416,17416, 124, 1115, 1132, 1182,12054,12048,12046, 0, + 1232,12039,12027,12039, 68, 230,12000,12014,11992, 0, + 1282, 1332, 9, 91, 237, 238, 103, 119, 247, 276, + 17416, 0, 1378, 279, 372, 472, 1428, 572, 478, 578, + 1478, 88, 250, 337, 258, 332, 261, 264, 0, 1528, + + 1578, 345, 267, 339, 360, 338, 266, 272, 0, 387, + 1628, 461, 473, 561, 1678, 772, 573, 761, 1728, 357, + 369, 740, 460, 440, 370, 463, 773, 492, 780, 1011, + 0, 1774, 1820, 343, 543, 19, 1023, 1038, 1870, 1073, + 1084, 1104, 1920, 560, 540, 563, 745, 753, 1000, 545, + 2, 761, 771, 988,12004, 0, 1970, 2020, 2070, 995, + 1010, 1041, 1045, 1004, 1020, 1039, 0, 1282, 2120, 2170, + 11988,11938,11947, 993, 430,11910,11916,11912, 1062, 0, + 0,11904,11901, 0, 1033, 2219, 1305, 1071,11891,11873, + 11794,11742, 1044, 730,11630,11625,11585, 1355,11574,11566, + + 2264, 1364, 1372, 1400, 1450, 1474,11530,11515,11494,11457, + 11436, 1071,11399,11341,11301,11205, 2313,17416, 2329, 0, + 1299, 1307, 2346, 2395, 0, 2440,11096,11054,11029, 1300, + 980,10900,10890,10869, 2490, 0, 0,10837,10737,10700, + 10687,10610, 1085,10544,10433,10404,10378, 0, 2540, 2590, + 1044, 1311, 749, 1088, 1329, 1312, 556, 1087, 1295, 1405, + 17416, 0, 2636, 1408, 1456, 1550, 1506, 2686, 1601, 1610, + 1650, 1700, 2736, 2785, 1274, 1330, 1379, 1285, 1365, 1380, + 561, 1381, 1384, 0, 2835, 2885, 1294, 1337, 1389, 1328, + 1415, 1408, 1091, 1385, 1421, 0, 1391, 2935, 1461, 1471, + + 1751, 1491, 1501, 2985, 1760, 1768, 1796, 1806, 3034, 3083, + 1430, 1402, 1434, 1435, 1515, 1479, 1480, 1452, 1484, 1518, + 1540, 1541, 1553, 1556, 1561, 0, 3129, 3175,10340, 1064, + 430, 1616, 1813, 1656, 3225, 1844, 1892, 1943, 1992, 3275, + 3324, 1525, 1532,10290, 1530, 1541,10252, 1575, 1557, 1558, + 1552, 1485, 1585, 1053,10215, 0, 3374, 3424, 3474, 1572, + 1607, 1608, 1592, 1627, 1629, 1609, 1633, 1634, 1695, 3524, + 10082,10032,10002, 9955, 9936, 1405, 9904, 9736, 9684, 9669, + 1644, 1835, 3573, 1635, 1652, 1658, 1673, 1687, 1680, 1681, + 1641, 1702, 2042, 2093, 2142, 1711, 2228, 2234, 2286, 2298, + + 2404, 2410, 2562, 1671, 1731, 1729, 1775, 1579, 3618, 3668, + 3718, 1695, 1715, 1738, 1746, 1762, 1780, 1808, 466, 1533, + 3768, 1707, 1771, 1689, 1769, 1815, 1817, 1786, 1818, 1825, + 3818, 1862, 1833, 1860, 1436, 1262, 1824, 1845, 1872, 1811, + 1850, 3868, 3918, 1873, 1870, 1871, 1875, 1881, 1886, 1876, + 1630, 1872, 2612, 2629, 2658, 1953, 2708, 2719, 2725, 2747, + 2807, 2857, 2907, 2003, 2108, 3007, 3013, 2048, 3968, 4018, + 4068, 1912, 1894, 1905, 1919, 1921, 1922, 1927, 1958, 1932, + 4118, 4168, 1962, 1923, 1968, 1970, 1966, 1971, 1949, 2008, + 1972, 2014, 2957, 3024, 3049, 2053, 3105, 3122, 3151, 3161, + + 3168, 3197, 3247, 2063, 2083, 2276, 2305, 2114, 4218, 4268, + 4318, 1986, 1924, 2007, 2006, 2022, 1999, 2031, 2075, 2057, + 4364, 4410, 9613, 3258, 3264, 3286, 2568, 3292, 3346, 3396, + 3446, 3496, 3582, 3588, 3407, 3656, 4344, 3706, 2664, 4460, + 4510, 4560, 2029, 2076, 2094, 2069, 2106, 2112, 2116, 2122, + 2124, 2130, 2125, 9552, 4610, 4660, 2032, 2198, 2127, 2226, + 2131, 2215, 2138, 2197, 2222, 4710, 2224, 2238, 2229, 2256, + 1894, 2205, 2280, 2258, 2266, 2262, 2205, 4760, 4810, 2077, + 2268, 2380, 2294, 2391, 2295, 2266, 2311, 2398, 3643, 3693, + 3742, 3891, 4860, 4910, 3940, 3990, 4041, 4090, 2403, 2143, + + 2409, 1590, 2528, 2584, 2411, 2534, 4960, 5010, 5060, 2546, + 2535, 2533, 2511, 2543, 2553, 2555, 2549, 2575, 5110, 2596, + 2315, 2534, 2379, 2580, 2282, 2600, 2570, 2378, 2614, 5160, + 2590, 1344, 2591, 2621, 2625, 2633, 2640, 2647, 2616, 2658, + 5210, 5260, 2647, 2669, 2679, 2596, 2642, 2690, 2692, 2718, + 2711, 4142, 4192, 4240, 4291, 5310, 4350, 4357, 4386, 4396, + 2863, 4433, 2919, 4101, 3906, 5360, 4056, 4306, 5396, 5446, + 5496, 2727, 2722, 2739, 2657, 2726, 2742, 2746, 2740, 2750, + 5546, 5596, 2751, 2743, 2761, 2756, 2770, 2783, 2788, 2784, + 2791, 4482, 4533, 4582, 4633, 5646, 5696, 4784, 4682, 4834, + + 4882, 2846, 2829, 2797, 2858, 2910, 2929, 2896, 2948, 5746, + 5796, 5846, 2793, 2790, 2848, 2840, 2792, 2878, 2806, 2819, + 2883, 5892, 4932, 4982, 5032, 5082, 5942, 5232, 5282, 5332, + 5343, 2968, 5349, 4448, 4151, 4548, 5992, 4648, 5372, 6028, + 6078, 6128, 2843, 2687, 2886, 2894, 2896, 2841, 2939, 2919, + 2941, 2944, 6178, 6228, 2968, 2974, 2978, 2989, 2984, 2997, + 3008, 2986, 3016, 6278, 3020, 3025, 3024, 3026, 3032, 3042, + 3043, 3041, 3047, 3056, 6328, 6378, 3066, 3072, 3076, 3080, + 3081, 3097, 3111, 3082, 3114, 6428, 6478, 6528, 6578, 2712, + 1748, 3098, 3130, 3136, 3172, 2944, 3184, 2683, 3182, 9506, + + 6628, 6678, 3136, 2647, 2953, 3159, 3134, 3175, 3176, 3177, + 2972, 6728, 2838, 3187, 3044, 2710, 3172, 3060, 3197, 3204, + 3079, 3216, 6778, 3220, 3217, 3218, 3234, 9474, 3221, 3184, + 3245, 3201, 3246, 6828, 6878, 3267, 3147, 3274, 3279, 3269, + 3275, 3280, 3291, 3292, 6928, 6978, 7028, 3457, 4793, 3951, + 5384, 5868, 5421, 3996, 5878, 4201, 5434, 3751, 7078, 7128, + 3293, 3309, 3324, 3308, 3285, 3319, 3323, 3326, 3332, 7178, + 7228, 3331, 3341, 3360, 3335, 3340, 3361, 3365, 3347, 3374, + 7278, 7328, 7378, 7428, 3417, 3449, 3639, 3436, 3961, 3437, + 3468, 3578, 3630, 3499, 3502, 7478, 7528, 3382, 3387, 3380, + + 3425, 3390, 3384, 3469, 3430, 3480, 7578, 7628, 7678, 4251, + 5468, 4493, 5521, 5965, 5534, 4888, 5888, 4593, 5571, 4693, + 7728, 7778, 3487, 3484, 3549, 3483, 3591, 3457, 3566, 3571, + 3612, 7828, 7878, 3491, 3618, 3624, 3652, 3663, 3557, 3586, + 3625, 3626, 7928, 3672, 3655, 3674, 3679, 3676, 3673, 3713, + 7978, 8028, 3726, 3670, 3704, 3702, 3719, 3721, 3841, 3724, + 3733, 8078, 9454, 5618, 8128, 2946, 3856, 3061, 9423, 3863, + 3425, 3462, 3611, 3738, 3252, 3017, 3876, 9352, 9249, 8178, + 8228, 3859, 3337, 3876, 3883, 9170, 3862, 3911, 3875, 3881, + 8278, 3902, 3911, 3917, 3922, 9123, 3914, 3877, 3921, 3574, + + 3939, 8328, 9122, 3941, 3972, 3978, 3893, 9097, 3981, 3982, + 3983, 3985, 8378, 8428, 4003, 4008, 3984, 4011, 9076, 3992, + 4016, 4023, 4027, 8478, 5668, 8528, 4938, 4843, 4988, 5038, + 5584, 5720, 5770, 5479, 5821, 5238, 5674, 5834, 5093, 5293, + 8578, 8628, 4030, 4029, 4041, 4060, 9036, 4061, 4072, 4031, + 4083, 8678, 8728, 4058, 4062, 4090, 4070, 8993, 4086, 4122, + 4111, 4128, 8778, 4112, 5980, 8828, 4129, 4211, 4180, 4156, + 4206, 4280, 4312, 4261, 4181, 4387, 4246, 4407, 4241, 4301, + 8878, 8928, 4140, 4172, 4136, 4112, 8946, 4166, 4224, 4211, + 4231, 8978, 6002, 9028, 5920, 5629, 6050, 5930, 6100, 6152, + + 6202, 6111, 6253, 6056, 6350, 6402, 6356, 6450, 9078, 9128, + 4210, 4271, 4276, 4311, 8863, 4320, 4253, 4316, 4334, 9178, + 9228, 4312, 4358, 4281, 4372, 8822, 4400, 4371, 4373, 4403, + 9278, 4402, 4418, 4410, 8593, 4419, 4435, 3125, 9328, 9378, + 4432, 4458, 4421, 4451, 8470, 4452, 4464, 4470, 4477, 6500, + 8445, 8311, 6550, 6600, 6650, 6700, 4483, 4384, 4498, 4470, + 8204, 8125, 1489, 4507, 4503, 4184, 8098, 4427, 9428, 9478, + 4287, 4559, 4464, 4587, 4764, 4496, 4494, 4659, 2756, 9528, + 7963, 4533, 4518, 4523, 4520, 7901, 4550, 4553, 4564, 4570, + 9578, 4582, 4314, 4640, 4510, 4759, 5064, 4597, 4559, 4783, + + 4577, 9628, 9678, 4580, 4833, 4599, 4869, 5264, 4612, 4597, + 4887, 4649, 6850, 6900, 6950, 7000, 7050, 7100, 7153, 7166, + 6456, 6506, 6556, 6611, 7202, 7250, 7304, 6656, 6856, 9728, + 9778, 4647, 4919, 4648, 4931, 5350, 4662, 4598, 4969, 4652, + 9828, 9878, 4740, 4981, 4661, 4987, 5600, 4748, 4603, 5019, + 4663, 7350, 4821, 4848, 7400, 7450, 7500, 7550, 5053, 5073, + 5221, 5253, 5233, 5243, 5337, 5338, 5422, 5417, 5323, 5490, + 9928, 9978, 4774, 5366, 4664, 5416, 5698, 4798, 4783, 5469, + 4749, 7600, 7650, 7700, 7750, 7800, 7850, 7316, 7903, 6956, + 6711, 6911, 7011, 8002, 7261, 8066, 7056, 7356,10028,10078, + + 4830, 5473, 4737, 5475, 5748, 4857, 4809, 5486, 4831,10128, + 10178, 4899, 5525, 4761, 5619, 5785, 4913, 4849, 5655, 4852, + 10228, 5023, 5556, 4870, 5608, 4823,10278,10328, 4949, 5667, + 4862, 5675, 5982, 5046, 4859, 5716, 4902, 8051, 8100, 8150, + 4875, 8203, 8252, 8401, 8451, 8500, 8550, 8601, 4980, 4238, + 7839, 5207, 7661, 7579, 4956, 4925,10378,10428,10478, 5765, + 5391, 5273, 4553, 5413, 5281, 4923, 7548, 4920, 4975, 4928, + 4337, 7483, 5563, 5409, 4968,10528, 5004, 5015, 5471, 4960, + 5576, 6130, 5040, 5183, 5763, 5227,10578, 4119, 5766, 5006, + 5061, 5059, 5276, 5288, 5258, 5227, 5290, 5299,10628,10678, + + 5816, 5007, 5404, 7343, 5070, 5328, 5431, 5503, 7315, 5506, + 8651, 8701, 8751, 8800, 8850, 8901, 8951, 9000, 9050, 9101, + 8216, 8416, 7106, 7406, 7456, 7506, 7561, 8466,10728,10778, + 10828, 5858, 7606, 5340, 7656, 5415, 7295, 5220, 5433, 5531, + 5550, 7275, 7706, 5565,10878,10928, 5955, 5483, 5585, 7217, + 5456, 5533, 5601, 5632, 7116, 5654, 9151, 9201, 9251, 5857, + 9353, 9402, 9450, 9501, 9650, 9701, 9750, 5759, 5817, 5708, + 5975, 5734, 5925, 5985, 5935,10978,11028,11078, 6013, 5970, + 5634, 6041, 5659, 7017, 5514, 5661, 5614, 5663, 6936, 6051, + 5704, 9801, 9850, 9901, 9950,10001,10050,10101,10150,10201, + + 10300, 8616, 8666, 7756, 7856, 7811, 8106, 8161, 8716,11128, + 11178,11228, 6045, 8261, 5701, 8506, 5685, 6753, 5559, 5734, + 5699, 5802, 6698, 8556, 5889,11278,11328, 6147, 5766, 5754, + 6677, 5656, 5783, 5843, 5929, 6645, 5948,11378, 6187, 5847, + 11428,11478, 6189, 5832, 5992, 6546, 5705, 5885, 5890, 6036, + 6373, 6039,10353,10402,10450,10501,11528,11578,10650,10701, + 10750,10800, 5981, 5193, 6343, 4628, 6216, 6154,11628,11678, + 11728, 5995, 5517, 6071, 5739, 5845, 5903, 6034, 5893, 6063, + 6078, 6082, 6104, 6019, 6101, 6069,11778, 6044, 6145, 6076, + 5587, 6096, 6095, 6098, 5523, 6147, 6139, 6172,11828, 5930, + + 6189, 6124, 6160, 6167, 6185, 6129, 6207, 6217, 5945, 6046, + 11878,11928, 6227, 6176, 6203, 6216, 6225, 6213, 6228, 6234, + 6313, 6319,10853,10902,10951,11000,11978,11050,11101,11150, + 11200, 8766, 8806, 8856, 8916, 8961, 9006,12028,12078,12128, + 9056, 6331, 6229, 6235, 6230, 6305, 6329, 6309, 6333, 6351, + 6352,12178,12228, 6375, 6365, 6354, 6374, 6373, 6385, 6332, + 6386, 6379, 6401,11253,11302,11351,11450,12278,12328,11503, + 11552,11600,11650, 6571, 6441, 6451, 6539, 6461, 6471,12378, + 12428,12478, 6501, 6529, 6381, 6427, 6402, 6459, 6432, 6452, + 6477, 6471, 6491,11700,11750,11900,11950,12528,12000,12050, + + 12100,12150, 9456, 9111, 9161, 9216, 9261, 9361,12578,12628, + 12678, 9411, 6631, 6473, 6478, 6483, 6509, 6484, 6502, 6523, + 6521, 6541,12728,12778, 6831, 6552, 6569, 6553, 6531, 6567, + 6571, 6584, 6563, 6596,12828,12878,12928, 6929, 6581, 6585, + 6601, 6578, 6629, 6641, 6634, 6619, 6663,12978,13028,13078, + 13128, 6400, 6074, 6191, 6024,13178,13228, 6687, 6622, 5259, + 6651, 6845, 5897, 6669, 6658, 6303, 6877, 6340, 6433, 5969, + 13278, 6674, 6807, 6676, 6684, 6681, 6609, 6689, 6839, 6829, + 6818, 6868,13328, 6825, 6865, 6841, 5799, 6907, 6882, 6885, + 6887, 6908, 6941, 6880, 6929, 6927,13378,13428, 6967, 6945, + + 6962, 6977, 6982, 6950, 6930, 6983, 7003, 6903, 6973, 5852, + 13478,13528,13578, 9656, 9511, 9711, 9756,13628,13678, 7022, + 7014, 7000, 7077, 7033, 6995, 7028, 7045, 7095, 7025, 7068, + 5580,13728,13778, 7122, 7064, 7050, 7158, 7075, 7090, 7080, + 7083, 7201, 7110, 7119, 5483,13828,13878,13928,13978, 7189, + 7216, 7239, 7253,14028,14078, 7175, 7124, 7100, 7203, 7125, + 7101, 7134, 7133, 7208, 7220, 7169, 5389,14128,14178,14228, + 9856, 9811, 9911, 9956,14278,14328, 7233, 7173, 7170, 7268, + 7266, 7252, 7227, 7271, 7345, 7270, 7278, 5340,14378,14428, + 7326, 7273, 7272, 7351, 7333, 7301, 7304, 7353, 7395, 7280, + + 7377, 5235, 7325, 6853, 7426, 7381, 7079, 7427, 7383, 7035, + 7255, 7415, 7455, 7379, 2862, 6985,14478, 5206,12200,14528, + 6816, 7394, 7332, 7334, 3362, 7026, 7350, 7182, 7445, 7249, + 107, 7462, 7375, 7433, 7501, 7489, 7495, 7430, 7445, 7482, + 7483, 7518, 7514, 7488, 7539, 7531, 5443, 7534, 7533, 7601, + 7479, 7529, 7551, 7541, 7559, 7582, 7579, 7580, 7581, 6435, + 7609, 7577, 7611, 7657, 7410, 7584, 7623, 7627, 7622, 7553, + 7624, 7625, 1892, 7654, 7633, 7651, 7695, 7450, 7662,14578, + 12250,14628,10716,10011, 7673, 7683, 7684, 7675, 7678, 7700, + 10056, 7630, 7712, 7723, 7725,10111, 7727, 7718, 7714, 7754, + + 7762, 7764, 7732, 7730, 7751, 7680, 7775, 7769, 7777, 7845, + 7780, 7795,14678, 7821,12300,14728, 7891, 7841, 7812, 7823, + 7840, 7827, 7858, 7833, 7989, 7785, 7869, 7872, 7873, 7990, + 7977, 7783, 7825,14778,12350,14828,10866,10156, 7884, 7885, + 7972, 7877, 7861, 7880,10211, 8000, 7970, 7976, 7978,10306, + 8003, 7995, 8002, 8010, 8013, 8033, 7982, 7960, 8020, 8050, + 8024, 8035, 8053, 8095, 8028, 8062, 8079, 8083, 7985, 8074, + 7424, 8101, 2566, 8085, 5123, 8102, 8151, 8118, 8084,12400, + 12450, 7749, 4935, 8123, 8116, 7601, 8120, 8190, 8208, 8101, + 349, 8132, 8158, 8390, 8172, 8237, 8191, 8169, 8133, 7509, + + 7859, 8179, 8224, 8225, 8226, 5012, 8031, 8181, 8229, 8377, + 8140, 8357, 8179, 8239, 8058, 8235, 8407, 8440, 8185, 4866, + 8365, 8441, 8382, 8210, 8350, 8372, 8420, 8374, 8458, 8477, + 5307, 8385, 8428, 8501, 8425, 8419,12500,12550,10361,10411, + 8473, 8474, 8480, 8423, 8527, 8545, 6975, 8482, 8525, 8551, + 10456, 8500, 8524, 8558, 8476, 8502, 8451, 8563, 8608, 7376, + 8530, 8533, 8640, 8567, 8574,12600,12650, 8711, 8591, 8578, + 8569, 8590, 8584, 8658, 8708, 8624, 8620, 8628, 8758, 8689, + 8670, 8625,12700,12750,10661,10511, 8623, 8667, 8622, 8634, + 8777, 8801, 8678, 8720, 8717, 8851,10756, 8700, 8675, 8723, + + 8719, 8751, 8725, 8863, 8890, 8752, 8775, 8783, 8908, 8701, + 8780, 8777, 8754, 8813, 4808, 8855, 8952, 7152, 8831, 8735, + 8954, 8801, 8826, 8844, 8503, 8827, 8858, 4734, 8956, 8871, + 8991, 8905, 8950, 8878, 8901, 8995, 8939, 8999, 8874, 8952, + 8808, 8538, 8982, 8876, 9051, 9057, 9001, 8879, 8986, 9090, + 8940, 4665, 8990, 9007, 9010, 9008, 9077, 8997, 9030, 9029, + 4572, 8673, 8925, 9032, 4516, 9100, 9065, 9068, 9030, 9085, + 10806, 9081, 9108, 9033, 4450,10911,10961, 9150, 9115, 9101, + 11006, 9123, 9135, 9125, 9134, 9075, 4416, 9168, 9133, 9169, + 9158, 9170, 9211, 9173, 9183, 9208, 4352, 9240, 9252, 9327, + + 9167, 9235, 9340, 9223, 9227,11056, 9233, 9234, 9308, 4255, + 11111,11156, 9352, 9184, 9330,11206, 9300, 9335, 9325, 9350, + 9364, 4059, 9403, 9333, 9369, 9373, 9377, 9383, 9405, 9385, + 9354, 9455, 9324, 9396, 9413, 9421, 4045, 9440, 9627, 9458, + 9645, 9422, 9471, 9488, 9490, 8383, 9473, 9500, 9612, 8782, + 9431, 9432, 3950, 9430, 9690, 9481, 9620, 9483, 9490, 9641, + 9677, 9631, 9702, 9639, 9633, 9680, 9659, 9678, 9700, 9714, + 9745, 9718, 9725, 9734, 9733,11261, 9703, 9763, 9765, 9845, + 11311, 9767, 9773, 9769, 9777, 9750, 9863, 9783, 9945, 9814, + 9825, 9795, 9827, 9841, 9803, 9963, 9865,10002, 9871, 9867, + + 9873, 9869, 9833,11361, 9895,10045, 9883,10063,11456, 9868, + 9914, 9923, 9884, 9903,10102, 9933,10163, 9918, 9967, 9984, + 9934, 9676,10055, 9996,10155,10015,10025, 9186, 9604,10070, + 10090, 9989, 9778,10145, 9990,10041, 9950, 3620,10073, 9975, + 10101,10157, 9733,10190, 9991, 9836,10036, 8909,10137,10084, + 10041,10059, 9937,10108,10112, 9878, 9978, 9801,10127,10165, + 10170,11511,10050,11561,10168,10104,10253,10178,10262,10251, + 10272,10284,10277,10273,10282,10340,10274,10341,10308,10351, + 10323,10300,10327,11606,10311,11656,10335,10354,10358,10369, + 10378,10329,10368,10379,10373,10375,10396,10176,10170, 7703, + + 10413,10184,10280,10105,10402,10441,10423,10430, 3909,10432, + 10434,10407,10451, 6908,10464,10431, 9637,10140,10389,10475, + 10460,10477,10454,10484,10604,10452, 3843,10481,10479,10617, + 10612,10602, 3780,10485,10618,10625,10628,10632, 3700,10635, + 10654,10633,10660,10675, 3660,10653,10671,10685,10678,10684, + 3540,10708,10674,10690,10712,10714, 3426,10726, 9755,10741, + 10729,10734,10751,10631,10730,10768,10483, 3299,10801, 3215, + 10731,10751,10779,10764,10780,10783, 3157,10790,10807,10810, + 10827,10819,10824,10822,10828, 3090,10858, 2981,10840,10825, + 10869, 2891,10903, 2802,10860,10882,10875, 2677,10950, 2595, + + 10885,10918,10900, 2452,10954, 2402,10908,10933,10925, 2363, + 10995, 2280,10935,10976,10934, 2037,11001, 1976,10880,10924, + 10975,10851,11005,10952,10980,11000,10762,11020,11045,11039, + 11051,11032,10959,11038,10990,11090,11060, 1951,10789,10984, + 11047,11137,11070,11069,11077,11095,11145,11125,11102,11112, + 11140,11706,11195,11127,11150,11162,11151,11201,11175,11190, + 11183,11217,11191,11268,11210,11219,11220,11225,11756,11301, + 11230,11229,11260,11250,11303,11080,11270,11084,11271,11427, + 11027,11176,11227,11317,11316,11350,11341,11340,11325,11110, + 11418,11451,11289,11131,11309,11330,11277,11402,11422,11424, + + 11454,11432,11451,11460,11906,11462,11469,11477,11479,11485, + 11500,11502,11518,11553,11508,11527,11529,11534,11956,11554, + 11551,11572,11574,11329,11127,11181,11419,11558,11252,11601, + 11576,11504,11479,11589,11601,11624,11610,11447,11607,11407, + 11604,11275,11677,11622,11620,11645,11701,11626,11630,11650, + 11877,11651,11658,11670,11901,11673,11676,11700,11945,11702, + 11714,11712,11951,11722,11521,11685,11727,11581,11977,11990, + 11905,11761,11733,11726,11868,11989,11681,11927,11987,11735, + 11995,12040,11853,12051,12053,12106,11874,12058,12101,11876, + 12140,12145,11939,11924,12151,12153,12206,11926,12158,12201, + + 11933,12005,12055, 1766,11999,12006,12105,12021,12071, 1704, + 12156,12227,11851,12019, 1364,12306,12356, 1306, 1194,12139, + 12191, 1144,12406,12456, 997, 962,11971,12111,12141,12240, + 12026,12237,12245,12295,12301,12327,12345,12351,12255,12205, + 12249,12239,12506,12289,12556,12256,17416,14878,14885,14892, + 14899,14906,14913,14920, 948,14927,14934,14941,14948,14954, + 14957, 791,14964,14968,14972,14979,14986,14993, 759,15000, + 15007,15014,15021,15028,15035,15042,15049,15053,15057,15064, + 15071,15078,15081,15083,15089,15096, 553, 292,15103,15110, + 15117,15124,15131,15138,15145,15151,15154, 260,15161,15165, + + 15169,15176,15183,15190,15197,15204,15211, 43,15218,15225, + 15232,15239,15246,15253,15260,15267,15274,15281,15288,15292, + 15296,15303,15310,15317,15324,15331,15338,15341,15343,15349, + 15356, 3,15363,15370,15377,15384,15391,15398,15405,15412, + 15419,15426,15433,15440,15447,15454,15461,15468,15475,15482, + 15489,15496,15503,15510,15517,15524,15531,15538,15545,15552, + 15559,15566,15570,15577,15584,15591,15598,15605,15612,15619, + 15626,15633,15640,15647,15654,15661,15668,15675,15682,15689, + 15696,15703,15710,15717,15724,15731,15738,15745,15752,15759, + 15766,15773,15780,15787,15794,15801,15808,15815,15822,15829, + + 15836,15843,15847,15854,15861,15868,15875,15882,15889,15896, + 15903,15910,15917,15924,15931,15938,15945,15952,15959,15966, + 15973,15980,15987,15994,16001,16008,16015,16022,16029,16036, + 16043,16050,16057,16064,16071,16078,16085,16092,16099,16106, + 16113,16120,16127,16134,16141,16148,16155,16162,16169,16176, + 16183,16190,16197,16204,16211,16218,16225,16232,16239,16246, + 16253,16260,16267,16274,16281,16288,16295,16302,16309,16316, + 16323,16330,16337,16344,16351,16358,16365,16372,16379,16386, + 16393,16400,16407,16414,16421,16428,16435,16442,16449,16456, + 16463,16470,16477,16484,16491,16498,16505,16512,16519,16526, + + 16533,16540,16547,16554,16561,16568,16575,16582,16589,16596, + 16603,16610,16617,16624,16631,16638,16645,16652,16659,16666, + 16673,16680,16687,16694,16701,16708,16715,16722,16729,16736, + 16743,16750,16757,16764,16771,16778,16785,16792,16799,16806, + 16813,16820,16827,16834,16841,16848,16855,16862,16869,16876, + 16883,16890,16897,16904,16911,16918,16925,16932,16939,16946, + 16953,16960,16967,16974,16981,16988,16995,17002,17009,17016, + 17023,17030,17037,17044,17051,17058,17065,17072,17079,17086, + 17093,17100,17107,17114,17121,17128,17135,17142,17149,17156, + 17163,17170,17177,17184,17191,17198,17205,17212,17219,17226, + + 17233,17240,17247,17254,17261,17268,17275,17282,17289,17296, + 17303,17310,17317,17324,17331,17338,17345,17352,17359,17366, + 17373,17380,17387,17394,17401,17408 + } ; + +static yyconst flex_int16_t yy_def[3227] = + { 0, + 2848, 2847, 2848, 2, 2847, 2847, 2849, 2847, 2850, 2847, + 2851, 2847, 2852, 2847, 3, 2, 3, 2, 2847, 2847, + 2853, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2854, 2855, + 2856, 2847, 2856, 2857, 2858, 2859, 2856, 2856, 2858, 39, + 39, 39, 39, 39, 39, 39, 2860, 2847, 2861, 2847, + 2847, 2847, 2861, 2860, 2847, 2847, 2856, 2856, 2856, 56, + 2847, 56, 56, 56, 56, 56, 56, 56, 56, 2862, + 2863, 2863, 72, 72, 72, 72, 72, 72, 72, 2847, + 2847, 2864, 2865, 32, 2866, 2866, 2867, 2868, 2866, 2866, + 2867, 91, 91, 91, 91, 91, 91, 91, 2869, 2870, + + 2870, 101, 101, 101, 101, 101, 101, 101, 2871, 2872, + 2873, 2874, 2874, 2875, 2876, 2877, 2874, 2874, 2876, 119, + 119, 119, 119, 119, 119, 119, 2847, 2847, 32, 2856, + 2878, 2879, 2879, 133, 133, 133, 2880, 2880, 2881, 2882, + 2880, 2880, 2881, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 2883, 2884, 2885, 2886, 2885, 159, + 159, 159, 159, 159, 159, 159, 2887, 2888, 2889, 2847, + 170, 170, 170, 170, 170, 170, 170, 170, 2847, 2890, + 2887, 2856, 2856, 32, 2856, 32, 2891, 2856, 2856, 186, + 186, 186, 186, 186, 186, 186, 186, 2892, 2893, 2893, + + 2889, 2891, 2891, 2894, 2895, 2856, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 2896, 2847, 2896, 219, + 2897, 2897, 2847, 223, 224, 2847, 224, 224, 224, 224, + 224, 224, 224, 224, 2847, 235, 226, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 2898, 2899, 2899, + 250, 250, 250, 250, 250, 250, 250, 250, 250, 2847, + 2847, 2900, 2901, 32, 2902, 2903, 2902, 2904, 2905, 2905, + 2906, 2907, 2902, 2904, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 2908, 2909, 2909, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 2910, 2911, 2912, 2913, 2913, + + 2914, 2915, 2915, 2916, 2917, 2917, 2918, 2919, 2913, 2916, + 310, 310, 310, 310, 310, 310, 310, 310, 310, 2847, + 2847, 2847, 32, 2856, 2856, 2920, 2921, 2921, 328, 328, + 328, 2922, 2923, 2922, 2924, 2925, 2925, 2926, 2927, 2922, + 2924, 341, 341, 341, 341, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 2928, 2929, 2930, 2931, 2930, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 2932, 2847, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 2856, 2856, 32, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 2933, 2933, 2934, 2935, 2936, 2936, 2936, 2937, + + 2938, 2938, 2939, 2856, 2856, 2856, 2856, 2856, 2940, 2941, + 2941, 411, 411, 411, 411, 411, 411, 411, 411, 411, + 2847, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 2847, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 2942, 2942, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 2943, 2943, 2944, 2945, 2946, 2946, 2946, 2947, + 2948, 2948, 2949, 2945, 2945, 2945, 2945, 2945, 2950, 2951, + 2951, 471, 471, 471, 471, 471, 471, 471, 471, 471, + 2952, 2952, 482, 482, 482, 482, 482, 482, 482, 482, + 482, 2953, 2954, 2954, 2955, 2956, 2957, 2957, 2957, 2958, + + 2959, 2959, 2960, 2953, 2953, 2953, 2953, 2953, 2961, 2962, + 2962, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 2963, 2963, 522, 2964, 2964, 2965, 2966, 2967, 2967, 2967, + 2968, 2969, 2969, 2970, 2966, 2966, 2966, 2966, 2966, 2971, + 2972, 2972, 542, 542, 542, 542, 542, 542, 542, 542, + 542, 542, 542, 542, 2973, 2973, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 2847, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 2974, 2975, 2975, 579, + 579, 579, 579, 579, 579, 579, 579, 579, 2976, 2976, + 2976, 2977, 2978, 2979, 2980, 2980, 2980, 2981, 2974, 2974, + + 2974, 2974, 2974, 2974, 2974, 2974, 2982, 2983, 2983, 609, + 609, 609, 609, 609, 609, 609, 609, 609, 2847, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 2847, + 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, + 2984, 2984, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 2985, 2985, 2985, 2986, 2987, 2988, 2988, 2988, 2989, + 2990, 2990, 2990, 2990, 2990, 2990, 2990, 2990, 2991, 2992, + 2992, 671, 671, 671, 671, 671, 671, 671, 671, 671, + 2993, 2993, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 2994, 2994, 2994, 2995, 2996, 2997, 2998, 2998, 2998, + + 2999, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3001, + 3002, 3002, 712, 712, 712, 712, 712, 712, 712, 712, + 712, 3003, 3004, 3004, 3004, 3005, 3006, 3007, 3007, 3007, + 3008, 3009, 3009, 3009, 3009, 3009, 3009, 3009, 3009, 3010, + 3011, 3011, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 742, 3012, 3012, 754, 754, 754, 754, 754, 754, + 754, 754, 754, 2847, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 3013, 3014, 3014, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 3015, 3016, 3017, 3018, 3013, + 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3019, + + 3020, 3020, 802, 802, 802, 802, 802, 802, 802, 802, + 802, 2847, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 2847, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 3021, 3021, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 3022, 3023, 3024, 3025, 3025, 3025, + 3025, 3025, 3025, 3025, 3025, 3025, 3025, 3026, 3027, 3027, + 860, 860, 860, 860, 860, 860, 860, 860, 860, 3028, + 3028, 871, 871, 871, 871, 871, 871, 871, 871, 871, + 3029, 3030, 3031, 3032, 3033, 3033, 3033, 3033, 3033, 3033, + 3033, 3033, 3033, 3033, 3034, 3035, 3035, 897, 897, 897, + + 897, 897, 897, 897, 897, 897, 3036, 3037, 3038, 3039, + 3039, 3039, 3039, 3039, 3039, 3039, 3039, 3039, 3039, 3040, + 3041, 3041, 922, 922, 922, 922, 922, 922, 922, 922, + 922, 3042, 3042, 933, 933, 933, 933, 933, 933, 933, + 933, 933, 2847, 943, 943, 943, 943, 943, 943, 3013, + 3043, 3043, 952, 952, 952, 952, 952, 952, 952, 952, + 952, 3044, 3045, 3046, 3047, 3013, 3013, 3013, 3013, 3013, + 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3048, 3048, 3049, + 3049, 981, 981, 981, 981, 981, 981, 981, 981, 981, + 2847, 991, 991, 991, 991, 991, 991, 991, 991, 991, + + 991, 2847, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 3050, 3050, 1014, 1014, 1014, 1014, 1014, 1014, + 1014, 1014, 1014, 3051, 3052, 3053, 3054, 3054, 3054, 3054, + 3054, 3054, 3054, 3054, 3054, 3054, 3054, 3054, 3055, 3055, + 3056, 3056, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, + 1042, 3057, 3057, 1053, 1053, 1053, 1053, 1053, 1053, 1053, + 1053, 1053, 3058, 3059, 3060, 3061, 3062, 3062, 3062, 3062, + 3062, 3062, 3062, 3062, 3062, 3062, 3062, 3062, 3063, 3063, + 3064, 3064, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1082, + 1082, 3065, 3066, 3067, 3068, 3068, 3068, 3068, 3068, 3068, + + 3068, 3068, 3068, 3068, 3068, 3068, 3069, 3069, 3070, 3070, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 3071, + 3071, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, + 2847, 1131, 1131, 1131, 1131, 1131, 1131, 3013, 3072, 3072, + 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 3073, + 3074, 3074, 3075, 3075, 3076, 3077, 3013, 3013, 3013, 3013, + 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3078, 3079, 3079, + 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 2847, + 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, + 2847, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + + 1191, 3080, 3080, 1203, 1203, 1203, 1203, 1203, 1203, 1203, + 1203, 1203, 3081, 3082, 3082, 3083, 3084, 3085, 3085, 3085, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3086, 3087, + 3087, 1231, 1231, 1231, 1231, 1231, 1231, 1231, 1231, 1231, + 3088, 3088, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 3089, 3090, 3090, 3091, 3091, 3092, 3093, 3094, 3094, + 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3095, + 3096, 3096, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, + 1272, 3097, 3098, 3098, 3099, 3100, 3101, 3101, 3101, 3101, + 3101, 3101, 3101, 3101, 3101, 3101, 3101, 3102, 3103, 3103, + + 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 3104, + 3104, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, + 2847, 1321, 1321, 1321, 1321, 3013, 3105, 3105, 1328, 1328, + 1328, 1328, 1328, 1328, 1328, 1328, 1328, 3106, 3106, 3107, + 3108, 3109, 3109, 3109, 3110, 3111, 3111, 3112, 3013, 3013, + 3013, 3013, 3013, 3013, 3013, 3013, 3113, 3114, 3114, 1359, + 3013, 3013, 1359, 3013, 3013, 1359, 1359, 1359, 1359, 1359, + 1359, 1359, 3013, 3013, 1359, 2847, 1376, 1376, 1376, 1376, + 1376, 1376, 1376, 1376, 1376, 1376, 2847, 1387, 1387, 1387, + 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 3115, 3115, + + 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1400, + 3116, 3116, 3117, 3118, 3118, 3118, 3119, 3120, 3120, 3121, + 3122, 3122, 3122, 3122, 3122, 3122, 3122, 3122, 3123, 3124, + 3124, 1431, 3122, 1431, 3122, 1431, 1431, 1431, 1431, 1431, + 1431, 1431, 3122, 1431, 3125, 3125, 1446, 1446, 1446, 1446, + 1446, 1446, 1446, 1446, 1446, 1446, 3126, 3126, 3127, 3128, + 3129, 3129, 3129, 3130, 3131, 3131, 3132, 3133, 3133, 3133, + 3133, 3133, 3133, 3133, 3133, 3134, 3135, 3135, 1478, 3133, + 1478, 3133, 1478, 1478, 1478, 1478, 1478, 1478, 1478, 3133, + 1478, 3136, 3136, 3137, 3138, 3138, 3138, 3139, 3140, 3140, + + 3141, 3142, 3142, 3142, 3142, 3142, 3142, 3142, 3142, 3143, + 3144, 3144, 1512, 3142, 1512, 3142, 1512, 1512, 1512, 1512, + 1512, 1512, 1512, 3142, 1512, 3145, 3145, 1527, 1527, 1527, + 1527, 1527, 1527, 1527, 1527, 1527, 1527, 2847, 1538, 3146, + 3147, 3147, 1542, 1542, 1542, 1542, 1542, 1542, 1542, 1542, + 1542, 1542, 3148, 3148, 3148, 3149, 3150, 3151, 3152, 3152, + 3152, 3153, 3146, 3146, 3146, 3146, 3146, 3146, 3154, 3155, + 3155, 3146, 3146, 1571, 3146, 1571, 3146, 1571, 1571, 1571, + 1571, 1571, 1571, 1571, 3146, 1571, 2847, 1587, 1587, 1587, + 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 2847, 1599, + + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 3156, 3156, 1612, 1612, 1612, 1612, 1612, 1612, 1612, 1612, + 1612, 1612, 3157, 3157, 3157, 3158, 3159, 3160, 3160, 3160, + 3161, 3162, 3162, 3162, 3162, 3162, 3162, 3163, 3164, 3164, + 3162, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640, + 1640, 3165, 3165, 1653, 1653, 1653, 1653, 1653, 1653, 1653, + 1653, 1653, 1653, 3166, 3166, 3166, 3167, 3168, 3169, 3170, + 3170, 3170, 3171, 3172, 3172, 3172, 3172, 3172, 3172, 3173, + 3174, 3174, 3172, 1682, 1682, 1682, 1682, 1682, 1682, 1682, + 1682, 1682, 1682, 3175, 3175, 3175, 3176, 3177, 3178, 3178, + + 3178, 3179, 3180, 3180, 3180, 3180, 3180, 3180, 3181, 3182, + 3182, 3180, 1711, 1711, 1711, 1711, 1711, 1711, 1711, 1711, + 1711, 1711, 3183, 3183, 1724, 1724, 1724, 1724, 1724, 1724, + 1724, 1724, 1724, 1724, 2847, 3184, 3184, 1737, 1737, 1737, + 1737, 1737, 1737, 1737, 1737, 1737, 1737, 3185, 3186, 3187, + 3188, 3189, 3189, 3189, 3190, 3191, 3191, 3189, 1757, 1757, + 1757, 1757, 1757, 1757, 1757, 1757, 1757, 1757, 1757, 1757, + 2847, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 2847, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 3192, 3192, 1798, 1798, + + 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, + 3193, 3194, 3195, 3196, 3196, 3196, 3197, 3198, 3198, 1819, + 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, + 1819, 3199, 3199, 1833, 1833, 1833, 1833, 1833, 1833, 1833, + 1833, 1833, 1833, 1833, 1833, 3200, 3201, 3202, 3203, 3204, + 3204, 3204, 3205, 3206, 3206, 1855, 1855, 1855, 1855, 1855, + 1855, 1855, 1855, 1855, 1855, 1855, 1855, 3207, 3208, 3209, + 3180, 3180, 3180, 3210, 3211, 3211, 1876, 1876, 1876, 1876, + 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 3212, 3212, + 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, + + 1890, 1890, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, + 1737, 1737, 1737, 1737, 1737, 1737, 3185, 3213, 3214, 3188, + 3189, 3189, 1757, 1757, 1757, 1757, 1757, 1757, 3189, 3189, + 1757, 1757, 1757, 1757, 3189, 3189, 1757, 1757, 1757, 1771, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1771, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1798, 1798, 1798, 1798, + 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 3193, + 3215, 3195, 3196, 3196, 1819, 1819, 1819, 1819, 1819, 1819, + 3196, 1819, 1819, 1819, 1819, 3196, 1819, 1819, 1819, 1833, + + 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, + 1833, 1833, 3200, 3216, 3217, 3203, 3204, 3204, 1855, 1855, + 1855, 1855, 1855, 1855, 3204, 1855, 1855, 1855, 1855, 3204, + 1855, 1855, 1855, 3207, 3218, 3209, 3180, 3180, 1876, 1876, + 1876, 1876, 1876, 1876, 3180, 1876, 1876, 1876, 1876, 3180, + 1876, 1876, 1876, 1890, 1890, 1890, 1890, 1890, 1890, 1890, + 1890, 1890, 1890, 1890, 1890, 1890, 1737, 1737, 1737, 1737, + 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 3219, + 3220, 3189, 3189, 1757, 1757, 1757, 1757, 1757, 1757, 3189, + 1757, 1757, 1757, 1757, 3189, 3189, 3189, 1757, 1757, 1771, + + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1798, 1798, 1798, 1798, 1798, 1798, + 1798, 1798, 1798, 1798, 1798, 1798, 3221, 3222, 3196, 3196, + 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, + 3196, 1819, 1819, 1833, 1833, 1833, 1833, 1833, 1833, 1833, + 1833, 1833, 1833, 1833, 1833, 3223, 3224, 3204, 3204, 1855, + 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855, 3204, + 1855, 1855, 3225, 3226, 3180, 3180, 1876, 1876, 1876, 1876, + 1876, 1876, 1876, 1876, 1876, 1876, 3180, 1876, 1876, 1890, + + 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, + 1890, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, + 1737, 1737, 1737, 3189, 1757, 1757, 1757, 1757, 3189, 3189, + 3189, 3189, 1757, 1757, 1757, 3189, 3189, 3189, 1757, 1757, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, 1798, + 3196, 1819, 1819, 1819, 1819, 3196, 3196, 1819, 1819, 1819, + 3196, 1819, 1819, 1833, 1833, 1833, 1833, 1833, 1833, 1833, + 1833, 1833, 3204, 1855, 1855, 1855, 1855, 3204, 3204, 1855, + + 1855, 1855, 3204, 1855, 1855, 3180, 1876, 1876, 1876, 1876, + 3180, 3180, 1876, 1876, 1876, 3180, 1876, 1876, 1890, 1890, + 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1737, 1737, 1737, + 1737, 1737, 1737, 1737, 1737, 1737, 3189, 1757, 1757, 1757, + 1757, 3189, 3189, 3189, 3189, 1757, 1757, 3189, 1757, 1757, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1798, 1798, 1798, + 1798, 1798, 1798, 1798, 1798, 3196, 1819, 1819, 1819, 1819, + 3196, 1819, 1819, 1819, 1819, 1833, 1833, 1833, 1833, 1833, + 1833, 1833, 1833, 3204, 1855, 1855, 1855, 1855, 3204, 1855, + + 1855, 1855, 1855, 3180, 1876, 1876, 1876, 1876, 3180, 1876, + 1876, 1876, 1876, 1890, 1890, 1890, 1890, 1890, 1890, 1890, + 1890, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1737, 1757, + 3189, 3189, 1757, 3189, 3189, 3189, 1757, 1757, 1757, 1757, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1783, 1783, + 1783, 1783, 1783, 1783, 1798, 1798, 1798, 1798, 1798, 1798, + 1819, 3196, 1819, 3196, 1819, 1819, 1819, 1819, 1833, 1833, + 1833, 1833, 1833, 1833, 1855, 3204, 1855, 3204, 1855, 1855, + 1855, 1855, 1876, 3180, 1876, 3180, 1876, 1876, 1876, 1876, + 1890, 1890, 1890, 1890, 1890, 1890, 1737, 1737, 1737, 1737, + + 1737, 1737, 1757, 3189, 1757, 3189, 1757, 1757, 1757, 1757, + 1771, 1771, 1771, 1771, 1771, 1771, 1783, 1783, 1783, 1783, + 1783, 1783, 1798, 1798, 1798, 1798, 1798, 1798, 1819, 1819, + 1819, 1819, 1819, 1819, 1833, 1833, 1833, 1833, 1833, 1833, + 1855, 1855, 1855, 1855, 1855, 1855, 1876, 1876, 1876, 1876, + 1876, 1876, 1890, 1890, 1890, 1890, 1890, 1890, 1737, 1737, + 1737, 1737, 1737, 1737, 1757, 1757, 1757, 1757, 1757, 1757, + 1771, 1771, 1771, 1771, 1771, 1771, 1783, 1783, 1783, 1783, + 1783, 1783, 1798, 1798, 1798, 1798, 1798, 1798, 1819, 1819, + 1819, 1819, 1819, 1819, 1833, 1833, 1833, 1833, 1833, 1833, + + 1855, 1855, 1855, 1855, 1855, 1855, 1876, 1876, 1876, 1876, + 1876, 1876, 1890, 1890, 1890, 1890, 1890, 1890, 1737, 1737, + 1737, 1737, 1737, 1737, 1757, 1757, 1757, 1757, 3189, 3189, + 1757, 1771, 1771, 1771, 1771, 1771, 1771, 1783, 1783, 1783, + 1783, 1783, 1798, 1798, 1798, 1798, 1798, 1819, 1819, 1819, + 1819, 3196, 1819, 1833, 1833, 1833, 1833, 1833, 1855, 1855, + 1855, 1855, 3204, 1855, 1876, 1876, 1876, 1876, 3180, 1876, + 1890, 1890, 1890, 1890, 1890, 1737, 1737, 1737, 1737, 1737, + 1757, 1757, 1757, 1757, 3189, 3189, 3189, 1771, 1771, 1771, + 1771, 1771, 1783, 1783, 1783, 1783, 1798, 1798, 1798, 1798, + + 1819, 1819, 1819, 1819, 3196, 1833, 1833, 1833, 1833, 1855, + 1855, 1855, 1855, 3204, 1876, 1876, 1876, 1876, 3180, 1890, + 1890, 1890, 1890, 1737, 1737, 1737, 1737, 1757, 1757, 1757, + 1757, 3189, 1771, 1771, 1771, 1771, 1783, 1783, 1783, 1783, + 1798, 1798, 1798, 1798, 1819, 1819, 1819, 1819, 1833, 1833, + 1833, 1833, 1855, 1855, 1855, 1855, 1876, 1876, 1876, 1876, + 1890, 1890, 1890, 1890, 1737, 1737, 1737, 1737, 1757, 1757, + 3189, 3189, 1757, 1771, 1771, 1771, 1771, 1783, 1783, 1783, + 1798, 1798, 1798, 1819, 1819, 3196, 1819, 1833, 1833, 1833, + 1855, 1855, 3204, 1855, 1876, 1876, 3180, 1876, 1890, 1890, + + 1890, 1737, 1737, 1737, 3189, 3189, 3189, 3189, 3189, 1757, + 1771, 1771, 1771, 1783, 1798, 3196, 3196, 1819, 1833, 3204, + 3204, 1855, 3180, 3180, 1876, 1890, 1737, 3189, 3189, 1757, + 1771, 1783, 1798, 1819, 1833, 1855, 1876, 1890, 1737, 3189, + 3189, 1771, 3196, 3204, 3180, 3189, 0, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847 + } ; + +static yyconst flex_uint16_t yy_nxt[17467] = + { 0, + 26, 27, 28, 27, 26, 29, 26, 369, 26, 26, + 26, 26, 127, 129, 127, 129, 198, 26, 26, 26, + 179, 26, 179, 205, 183, 201, 201, 335, 128, 130, + 209, 183, 201, 201, 249, 212, 208, 201, 216, 215, + 201, 351, 327, 214, 213, 251, 331, 284, 26, 26, + 31, 32, 28, 32, 33, 34, 31, 35, 31, 31, + 31, 36, 35, 35, 35, 35, 35, 37, 31, 38, + 35, 31, 35, 39, 35, 40, 41, 35, 35, 42, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 43, + 44, 35, 35, 45, 46, 35, 35, 35, 31, 31, + + 26, 27, 28, 27, 26, 29, 26, 241, 26, 26, + 26, 26, 201, 268, 252, 242, 249, 26, 26, 26, + 2091, 26, 182, 182, 275, 182, 210, 182, 249, 222, + 222, 222, 222, 222, 211, 219, 222, 222, 222, 222, + 222, 203, 219, 204, 249, 257, 258, 201, 26, 26, + 26, 47, 48, 47, 26, 29, 26, 49, 50, 51, + 52, 26, 53, 53, 53, 53, 53, 26, 54, 26, + 49, 26, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 26, 26, + + 31, 55, 48, 55, 33, 34, 31, 56, 57, 58, + 59, 36, 60, 60, 60, 60, 60, 37, 61, 38, + 56, 31, 56, 62, 56, 63, 64, 56, 56, 65, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 66, + 67, 56, 56, 68, 69, 56, 56, 56, 31, 31, + 26, 27, 28, 27, 26, 29, 26, 243, 26, 26, + 26, 26, 249, 249, 248, 255, 244, 26, 26, 26, + 259, 26, 249, 276, 256, 268, 253, 260, 261, 260, + 264, 261, 264, 268, 254, 279, 268, 283, 282, 268, + 288, 285, 285, 294, 280, 295, 369, 285, 26, 26, + + 31, 32, 28, 32, 33, 34, 31, 71, 31, 31, + 31, 36, 71, 71, 71, 71, 71, 37, 31, 38, + 71, 31, 71, 72, 71, 73, 74, 71, 71, 75, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 76, + 77, 71, 71, 78, 79, 71, 71, 71, 31, 31, + 26, 80, 81, 80, 82, 29, 82, 268, 82, 82, + 82, 82, 268, 285, 285, 2233, 327, 82, 82, 82, + 285, 82, 182, 182, 281, 182, 277, 182, 289, 329, + 293, 287, 304, 266, 278, 285, 290, 291, 180, 201, + 180, 267, 312, 311, 304, 304, 292, 318, 82, 82, + + 31, 84, 81, 84, 85, 34, 86, 87, 86, 86, + 86, 88, 87, 87, 87, 87, 87, 89, 86, 90, + 87, 86, 87, 91, 87, 92, 93, 87, 87, 94, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 95, + 96, 87, 87, 97, 98, 87, 87, 87, 86, 86, + 26, 27, 28, 27, 26, 29, 26, 376, 26, 26, + 26, 26, 182, 327, 182, 304, 377, 26, 26, 26, + 523, 26, 182, 182, 182, 182, 182, 182, 182, 182, + 300, 182, 317, 182, 301, 304, 319, 315, 304, 272, + 617, 267, 300, 322, 201, 322, 316, 267, 26, 26, + + 31, 32, 28, 32, 33, 34, 31, 100, 31, 31, + 31, 36, 100, 100, 100, 100, 100, 37, 31, 38, + 100, 31, 100, 101, 100, 102, 103, 100, 100, 104, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 105, + 106, 100, 100, 107, 108, 100, 100, 100, 31, 31, + 109, 27, 28, 27, 109, 110, 109, 181, 109, 109, + 109, 109, 199, 343, 199, 335, 327, 109, 109, 109, + 335, 109, 182, 182, 182, 182, 182, 182, 182, 182, + 303, 182, 330, 182, 308, 335, 344, 350, 335, 249, + 450, 270, 300, 271, 268, 478, 342, 273, 109, 109, + + 112, 32, 28, 32, 113, 114, 112, 115, 112, 112, + 112, 116, 115, 115, 115, 115, 115, 117, 112, 118, + 115, 112, 115, 119, 115, 120, 121, 115, 115, 122, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 123, + 124, 115, 115, 125, 126, 115, 115, 115, 112, 112, + 26, 27, 28, 27, 131, 29, 131, 132, 131, 131, + 131, 131, 132, 132, 132, 132, 132, 131, 131, 131, + 132, 131, 132, 132, 132, 132, 132, 132, 133, 132, + 132, 132, 132, 132, 132, 134, 132, 132, 132, 132, + 132, 135, 132, 132, 132, 132, 136, 132, 131, 131, + + 31, 32, 28, 32, 137, 34, 138, 139, 138, 138, + 138, 140, 139, 139, 139, 139, 139, 141, 138, 142, + 139, 138, 139, 143, 139, 144, 145, 139, 146, 147, + 139, 139, 139, 139, 139, 148, 139, 139, 139, 149, + 150, 151, 139, 152, 153, 139, 154, 139, 138, 138, + 26, 27, 28, 27, 26, 29, 26, 388, 26, 26, + 156, 26, 182, 284, 182, 304, 389, 26, 26, 26, + 335, 26, 299, 182, 320, 182, 320, 299, 335, 313, + 309, 323, 249, 323, 345, 445, 335, 314, 352, 347, + 321, 306, 346, 307, 353, 248, 335, 324, 26, 26, + + 31, 32, 28, 32, 33, 34, 31, 157, 31, 31, + 158, 36, 157, 157, 157, 157, 157, 37, 31, 38, + 157, 31, 157, 159, 157, 160, 161, 157, 157, 162, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 163, + 164, 157, 157, 165, 166, 157, 157, 157, 31, 31, + 26, 27, 28, 27, 26, 29, 26, 30, 26, 26, + 26, 26, 167, 30, 30, 30, 30, 26, 26, 26, + 168, 26, 30, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 26, 26, + + 31, 32, 28, 32, 33, 34, 31, 35, 31, 31, + 31, 36, 169, 35, 35, 35, 35, 37, 31, 38, + 170, 31, 35, 171, 170, 172, 173, 170, 170, 174, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 175, + 176, 170, 170, 177, 178, 170, 170, 170, 31, 31, + 182, 184, 181, 184, 185, 182, 182, 186, 182, 182, + 182, 187, 186, 186, 186, 186, 186, 188, 182, 189, + 186, 182, 186, 190, 186, 191, 192, 186, 186, 193, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 194, + 195, 186, 186, 196, 197, 186, 186, 186, 182, 182, + + 182, 182, 2838, 182, 182, 182, 182, 426, 182, 182, + 182, 182, 325, 335, 325, 354, 427, 182, 182, 183, + 357, 182, 205, 182, 182, 335, 182, 348, 182, 357, + 183, 360, 374, 361, 333, 357, 349, 2837, 182, 182, + 375, 182, 334, 182, 198, 357, 366, 367, 182, 182, + 182, 182, 183, 182, 182, 182, 182, 334, 182, 182, + 182, 182, 368, 179, 357, 179, 357, 182, 182, 183, + 357, 182, 364, 182, 182, 207, 182, 249, 182, 443, + 362, 365, 205, 386, 182, 182, 335, 182, 363, 182, + 183, 387, 337, 554, 338, 339, 415, 327, 182, 182, + + 217, 218, 217, 334, 182, 182, 522, 182, 416, 182, + 436, 220, 220, 220, 220, 220, 2847, 2847, 2847, 446, + 249, 249, 437, 340, 285, 489, 451, 220, 220, 220, + 220, 220, 182, 223, 218, 223, 185, 182, 182, 224, + 182, 182, 182, 187, 225, 225, 225, 225, 225, 188, + 226, 189, 224, 182, 224, 227, 224, 228, 229, 224, + 224, 230, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 231, 232, 224, 224, 233, 234, 224, 224, 224, + 182, 182, 182, 182, 2836, 182, 182, 182, 182, 235, + 182, 182, 182, 182, 236, 236, 236, 236, 236, 182, + + 226, 183, 235, 182, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 182, 182, 182, 182, 2835, 182, 182, 182, 182, 226, + 182, 182, 182, 182, 237, 237, 237, 237, 237, 182, + 226, 183, 226, 182, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 182, 182, 182, 182, 235, 182, 182, 182, 182, 181, + 182, 182, 182, 182, 181, 181, 181, 181, 181, 182, + + 182, 183, 635, 182, 181, 182, 182, 268, 182, 471, + 182, 222, 222, 222, 222, 222, 474, 219, 268, 222, + 222, 222, 222, 222, 203, 219, 204, 285, 249, 482, + 182, 182, 182, 182, 452, 182, 182, 182, 182, 424, + 182, 182, 182, 182, 249, 249, 2834, 425, 449, 182, + 182, 183, 444, 182, 447, 182, 182, 250, 182, 485, + 182, 285, 249, 268, 182, 182, 448, 182, 825, 182, + 285, 472, 182, 182, 394, 182, 395, 182, 483, 235, + 182, 182, 262, 203, 262, 204, 262, 262, 262, 262, + 475, 397, 180, 204, 180, 262, 262, 262, 268, 262, + + 202, 202, 476, 202, 2833, 202, 260, 261, 260, 264, + 261, 264, 268, 268, 268, 473, 477, 268, 285, 399, + 479, 400, 285, 480, 490, 484, 262, 262, 182, 182, + 571, 182, 265, 182, 265, 304, 265, 265, 265, 265, + 486, 285, 572, 512, 488, 265, 265, 267, 285, 265, + 182, 182, 487, 182, 285, 182, 182, 182, 235, 182, + 491, 182, 182, 304, 182, 511, 514, 304, 304, 402, + 513, 403, 182, 634, 182, 267, 265, 265, 182, 182, + 300, 182, 265, 182, 265, 304, 265, 265, 265, 265, + 492, 519, 199, 381, 199, 265, 265, 267, 404, 265, + + 405, 406, 199, 274, 199, 407, 182, 182, 183, 182, + 303, 182, 304, 304, 518, 517, 408, 304, 335, 320, + 496, 320, 409, 520, 552, 456, 265, 265, 182, 182, + 1353, 182, 182, 182, 182, 321, 182, 182, 182, 182, + 515, 322, 322, 322, 322, 182, 182, 183, 304, 182, + 182, 182, 516, 182, 323, 182, 323, 325, 335, 325, + 542, 201, 325, 335, 325, 335, 545, 205, 618, 454, + 324, 455, 546, 543, 335, 183, 182, 182, 182, 182, + 183, 182, 182, 182, 182, 335, 182, 182, 182, 182, + 335, 335, 550, 549, 551, 182, 182, 183, 183, 182, + + 547, 182, 182, 286, 182, 357, 182, 556, 335, 183, + 182, 182, 548, 182, 606, 182, 182, 182, 335, 182, + 270, 182, 271, 559, 553, 357, 182, 182, 296, 457, + 793, 271, 296, 296, 296, 334, 296, 296, 296, 296, + 357, 357, 357, 563, 558, 296, 296, 296, 557, 296, + 202, 202, 560, 202, 650, 202, 182, 182, 249, 182, + 357, 182, 357, 381, 561, 562, 357, 357, 186, 459, + 579, 460, 564, 565, 186, 527, 296, 296, 299, 182, + 587, 182, 299, 299, 299, 186, 299, 299, 299, 299, + 183, 186, 409, 580, 581, 299, 299, 300, 599, 299, + + 182, 182, 181, 182, 582, 182, 186, 181, 181, 181, + 181, 181, 583, 186, 186, 586, 585, 181, 610, 462, + 186, 463, 224, 201, 584, 622, 299, 299, 299, 182, + 396, 182, 299, 299, 299, 186, 299, 299, 299, 299, + 224, 588, 620, 201, 2830, 299, 299, 300, 183, 299, + 183, 299, 182, 310, 182, 600, 299, 611, 601, 593, + 299, 182, 602, 182, 603, 299, 201, 183, 299, 182, + 494, 182, 495, 299, 201, 612, 299, 299, 326, 306, + 326, 307, 326, 326, 326, 326, 613, 497, 967, 307, + 201, 326, 326, 326, 183, 326, 305, 202, 614, 202, + + 623, 305, 224, 604, 224, 2827, 299, 182, 201, 182, + 605, 299, 621, 182, 182, 499, 182, 500, 182, 224, + 627, 615, 326, 326, 326, 502, 326, 503, 326, 326, + 326, 326, 525, 235, 526, 639, 201, 326, 326, 326, + 624, 326, 616, 328, 182, 182, 235, 182, 224, 182, + 224, 224, 625, 626, 381, 235, 632, 628, 224, 577, + 636, 405, 406, 337, 629, 338, 407, 235, 326, 326, + 182, 182, 235, 182, 332, 182, 332, 408, 332, 332, + 332, 332, 235, 409, 235, 640, 637, 332, 332, 334, + 631, 332, 182, 182, 235, 182, 643, 182, 249, 249, + + 249, 249, 633, 249, 249, 2131, 638, 651, 645, 249, + 649, 528, 644, 338, 249, 646, 201, 647, 332, 332, + 182, 182, 268, 182, 332, 182, 332, 648, 332, 332, + 332, 332, 249, 268, 768, 672, 673, 332, 332, 334, + 268, 332, 674, 202, 202, 341, 202, 268, 202, 268, + 268, 285, 304, 182, 182, 268, 182, 676, 182, 675, + 268, 678, 530, 677, 531, 684, 714, 680, 332, 332, + 182, 182, 456, 182, 182, 182, 182, 285, 182, 182, + 358, 182, 679, 689, 2693, 683, 268, 182, 182, 183, + 285, 182, 182, 182, 285, 182, 285, 182, 285, 285, + + 285, 469, 687, 182, 182, 685, 182, 691, 182, 713, + 686, 533, 688, 534, 304, 182, 2675, 182, 182, 182, + 182, 182, 267, 182, 182, 182, 182, 304, 182, 182, + 661, 182, 690, 492, 304, 304, 285, 182, 182, 183, + 718, 182, 182, 182, 715, 182, 716, 182, 182, 182, + 304, 182, 743, 182, 199, 755, 199, 335, 717, 304, + 357, 394, 509, 395, 182, 719, 182, 267, 182, 182, + 182, 182, 496, 182, 182, 182, 182, 2674, 182, 182, + 358, 182, 300, 668, 182, 304, 182, 182, 182, 183, + 702, 182, 721, 182, 182, 359, 182, 335, 182, 720, + + 777, 696, 300, 304, 335, 186, 746, 703, 182, 182, + 704, 182, 589, 182, 395, 182, 744, 182, 182, 182, + 182, 182, 335, 182, 182, 182, 182, 267, 182, 182, + 182, 182, 662, 300, 335, 663, 745, 182, 182, 183, + 335, 182, 393, 393, 335, 393, 747, 393, 748, 709, + 335, 554, 335, 335, 751, 357, 750, 749, 335, 357, + 752, 591, 183, 592, 757, 791, 357, 759, 182, 182, + 182, 182, 761, 182, 182, 182, 182, 201, 182, 182, + 182, 182, 201, 201, 201, 201, 201, 182, 182, 183, + 370, 182, 201, 370, 370, 370, 370, 370, 370, 370, + + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 182, 182, + 182, 762, 182, 182, 183, 357, 357, 201, 182, 182, + 182, 182, 774, 182, 182, 182, 182, 182, 183, 182, + 756, 769, 186, 357, 186, 186, 201, 397, 186, 204, + 357, 201, 764, 203, 357, 204, 760, 763, 186, 186, + 201, 765, 186, 186, 182, 182, 758, 182, 182, 182, + 182, 766, 182, 182, 182, 182, 594, 182, 201, 182, + 201, 182, 182, 183, 201, 182, 182, 182, 201, 182, + 772, 182, 771, 767, 186, 300, 186, 773, 202, 202, + + 783, 202, 201, 202, 224, 397, 182, 204, 182, 705, + 778, 706, 182, 182, 217, 218, 217, 399, 818, 400, + 2670, 770, 186, 186, 300, 220, 220, 220, 220, 220, + 2847, 2847, 2847, 707, 780, 784, 782, 224, 814, 186, + 708, 220, 220, 220, 220, 220, 182, 223, 218, 223, + 185, 182, 182, 224, 182, 182, 182, 187, 225, 225, + 225, 225, 225, 188, 226, 189, 224, 182, 224, 227, + 224, 228, 229, 224, 224, 230, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 231, 232, 224, 224, 233, + 234, 224, 224, 224, 182, 182, 182, 2847, 182, 182, + + 224, 224, 821, 2668, 182, 182, 182, 182, 186, 182, + 182, 182, 182, 182, 183, 182, 816, 779, 224, 186, + 224, 224, 183, 402, 224, 403, 186, 781, 183, 595, + 183, 403, 790, 785, 224, 224, 798, 792, 224, 224, + 182, 182, 2664, 182, 182, 182, 182, 226, 182, 182, + 182, 182, 237, 237, 237, 237, 237, 182, 226, 183, + 226, 182, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 182, 182, + 182, 182, 2662, 182, 182, 182, 182, 235, 182, 182, + + 182, 182, 236, 236, 236, 236, 236, 182, 226, 183, + 235, 182, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 182, 182, + 182, 182, 201, 182, 182, 182, 182, 183, 182, 182, + 182, 182, 806, 183, 794, 805, 224, 182, 182, 183, + 799, 182, 401, 401, 201, 401, 201, 401, 182, 182, + 803, 182, 804, 182, 201, 808, 815, 201, 809, 2218, + 201, 597, 807, 598, 201, 810, 201, 527, 182, 182, + 182, 182, 224, 182, 182, 182, 182, 811, 182, 182, + + 182, 182, 224, 183, 820, 186, 201, 182, 182, 183, + 795, 182, 182, 182, 796, 182, 540, 182, 224, 797, + 817, 824, 224, 442, 813, 235, 235, 249, 826, 182, + 182, 454, 182, 455, 182, 2658, 224, 839, 182, 182, + 262, 819, 262, 827, 262, 262, 262, 262, 652, 822, + 455, 235, 832, 262, 262, 262, 235, 262, 393, 393, + 235, 393, 830, 393, 182, 182, 828, 182, 235, 182, + 831, 836, 829, 249, 983, 235, 201, 654, 249, 655, + 833, 840, 235, 334, 262, 262, 182, 182, 268, 182, + 265, 182, 265, 235, 265, 265, 265, 265, 864, 739, + + 249, 838, 183, 265, 265, 267, 837, 265, 182, 182, + 249, 182, 841, 182, 347, 842, 976, 2657, 335, 182, + 182, 249, 182, 249, 182, 182, 182, 457, 182, 271, + 182, 183, 995, 844, 265, 265, 182, 182, 270, 182, + 271, 182, 249, 966, 457, 224, 271, 202, 202, 249, + 202, 861, 202, 268, 843, 456, 656, 268, 268, 862, + 464, 863, 465, 466, 866, 865, 459, 467, 460, 867, + 268, 268, 869, 268, 285, 872, 868, 268, 468, 1375, + 873, 268, 285, 874, 469, 182, 182, 285, 182, 265, + 182, 265, 285, 265, 265, 265, 265, 875, 182, 201, + + 182, 285, 265, 265, 267, 877, 265, 182, 182, 876, + 182, 878, 182, 880, 285, 285, 300, 898, 470, 285, + 879, 304, 285, 304, 304, 887, 462, 899, 463, 904, + 182, 902, 182, 265, 265, 182, 182, 304, 182, 182, + 182, 182, 2653, 182, 182, 182, 182, 182, 300, 182, + 304, 886, 182, 182, 183, 905, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 300, 182, 923, 182, 992, + 900, 304, 335, 224, 335, 885, 657, 300, 463, 304, + 927, 901, 267, 182, 182, 182, 182, 2078, 182, 182, + 182, 182, 848, 182, 182, 182, 182, 182, 888, 182, + + 903, 186, 182, 182, 183, 906, 182, 401, 401, 304, + 401, 182, 401, 182, 304, 300, 925, 335, 481, 182, + 182, 893, 182, 924, 182, 335, 659, 335, 660, 300, + 182, 2651, 182, 182, 182, 296, 889, 926, 267, 296, + 296, 296, 929, 296, 296, 296, 296, 850, 300, 182, + 335, 182, 296, 296, 296, 890, 296, 299, 182, 891, + 182, 928, 299, 183, 892, 183, 931, 300, 182, 182, + 335, 182, 335, 182, 894, 335, 494, 930, 495, 984, + 973, 1157, 201, 296, 296, 299, 182, 334, 182, 299, + 299, 299, 934, 299, 299, 299, 299, 910, 990, 357, + + 936, 201, 299, 299, 300, 357, 299, 182, 182, 357, + 182, 935, 182, 182, 182, 357, 182, 357, 182, 939, + 357, 2647, 941, 938, 299, 182, 267, 182, 357, 299, + 937, 940, 267, 299, 299, 182, 183, 182, 942, 357, + 664, 666, 665, 692, 944, 495, 805, 357, 667, 493, + 393, 370, 393, 492, 493, 370, 370, 370, 504, 1166, + 505, 506, 945, 370, 808, 507, 948, 946, 694, 811, + 695, 947, 370, 370, 370, 183, 508, 949, 370, 224, + 183, 994, 509, 299, 182, 950, 182, 299, 299, 299, + 953, 299, 299, 299, 299, 224, 1159, 186, 955, 997, + + 299, 299, 300, 186, 299, 299, 182, 186, 182, 954, + 299, 186, 186, 186, 224, 1000, 510, 183, 960, 958, + 957, 956, 299, 182, 497, 182, 307, 299, 186, 968, + 2646, 299, 299, 326, 959, 326, 961, 326, 326, 326, + 326, 306, 186, 307, 183, 186, 326, 326, 326, 183, + 326, 299, 182, 697, 182, 183, 299, 969, 970, 982, + 1326, 305, 202, 201, 202, 201, 305, 971, 299, 182, + 497, 182, 307, 299, 1016, 986, 249, 326, 326, 326, + 499, 326, 500, 326, 326, 326, 326, 502, 201, 503, + 2638, 183, 326, 326, 326, 985, 326, 299, 182, 972, + + 182, 183, 299, 183, 201, 201, 201, 224, 521, 977, + 974, 993, 987, 996, 975, 988, 698, 989, 503, 998, + 235, 1009, 224, 326, 326, 182, 182, 999, 182, 332, + 182, 332, 224, 332, 332, 332, 332, 235, 1001, 224, + 1004, 1011, 332, 332, 334, 1005, 332, 501, 401, 1003, + 401, 224, 501, 235, 235, 2631, 235, 235, 182, 182, + 1006, 182, 1008, 182, 182, 182, 700, 182, 701, 182, + 235, 183, 1012, 332, 332, 182, 182, 525, 182, 526, + 182, 235, 235, 723, 1010, 526, 393, 393, 1165, 393, + 1015, 393, 182, 182, 527, 182, 249, 182, 249, 535, + + 1017, 536, 537, 249, 249, 725, 538, 726, 249, 249, + 1019, 528, 1020, 338, 268, 1018, 1043, 539, 1023, 1021, + 249, 249, 268, 540, 182, 182, 1047, 182, 332, 182, + 332, 1022, 332, 332, 332, 332, 1044, 268, 268, 2628, + 727, 332, 332, 334, 1046, 332, 182, 182, 268, 182, + 1045, 182, 268, 268, 1054, 268, 1048, 541, 1051, 201, + 285, 268, 1049, 1172, 285, 337, 1050, 338, 1055, 285, + 285, 1057, 332, 332, 182, 182, 285, 182, 182, 182, + 182, 1058, 182, 182, 358, 182, 1056, 1061, 2086, 285, + 285, 182, 182, 183, 285, 182, 182, 182, 1059, 182, + + 1062, 182, 201, 285, 1060, 1083, 1085, 182, 182, 304, + 182, 304, 182, 304, 1084, 528, 304, 338, 182, 304, + 182, 1088, 182, 182, 182, 182, 334, 182, 182, 182, + 182, 1087, 182, 182, 732, 182, 300, 182, 182, 182, + 182, 182, 182, 183, 183, 182, 202, 202, 1067, 202, + 182, 202, 182, 1161, 304, 300, 300, 182, 182, 304, + 182, 1086, 182, 1070, 1073, 530, 2617, 531, 300, 182, + 1090, 182, 182, 182, 182, 182, 267, 182, 182, 182, + 182, 183, 182, 182, 358, 182, 335, 300, 1027, 1068, + 1162, 182, 182, 183, 1116, 182, 182, 182, 304, 182, + + 182, 182, 182, 978, 1074, 978, 1091, 555, 1089, 304, + 1111, 1112, 335, 335, 1122, 533, 335, 534, 300, 1114, + 357, 1080, 182, 182, 182, 182, 1078, 182, 182, 182, + 182, 201, 182, 182, 182, 182, 201, 201, 201, 201, + 201, 182, 182, 183, 370, 182, 201, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 182, 182, 182, 1113, 182, 182, 335, 182, + 2611, 182, 182, 182, 182, 182, 357, 182, 401, 401, + 182, 401, 183, 401, 1127, 335, 186, 300, 186, 186, + + 335, 728, 186, 534, 1075, 1117, 578, 730, 1076, 731, + 224, 1118, 186, 186, 1189, 357, 186, 186, 182, 182, + 335, 182, 182, 182, 182, 1128, 182, 182, 182, 182, + 183, 182, 1115, 182, 2508, 182, 182, 183, 1119, 182, + 182, 335, 182, 182, 182, 1123, 182, 357, 182, 300, + 1124, 1163, 1130, 357, 357, 357, 182, 182, 300, 182, + 201, 182, 589, 1077, 395, 1129, 182, 182, 182, 182, + 1069, 182, 182, 182, 182, 334, 182, 182, 182, 182, + 733, 357, 1133, 734, 370, 182, 182, 183, 1125, 182, + 608, 786, 357, 182, 182, 1132, 182, 1142, 182, 186, + + 2605, 370, 370, 370, 1126, 370, 182, 182, 370, 182, + 1134, 182, 394, 1137, 395, 1136, 182, 182, 182, 182, + 1135, 182, 182, 182, 182, 334, 182, 182, 182, 182, + 1143, 186, 183, 186, 737, 182, 182, 183, 1144, 182, + 2599, 738, 182, 182, 1138, 182, 609, 182, 186, 1141, + 186, 978, 978, 186, 978, 186, 978, 183, 1146, 1149, + 1145, 589, 186, 395, 1148, 1164, 182, 182, 182, 182, + 1040, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + + 224, 619, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 2593, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + 630, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 186, 182, 182, 182, 182, 183, 182, 182, 182, 182, + 1147, 201, 183, 2587, 201, 182, 182, 183, 1160, 182, + 641, 393, 393, 1158, 393, 183, 393, 201, 201, 1171, + + 1173, 1176, 1178, 201, 1167, 201, 182, 182, 1179, 182, + 591, 182, 592, 224, 1187, 235, 182, 182, 182, 182, + 1174, 182, 182, 182, 182, 267, 182, 182, 182, 182, + 1196, 1181, 852, 201, 1182, 182, 182, 183, 224, 182, + 182, 182, 1177, 182, 1183, 182, 642, 224, 1184, 2569, + 224, 182, 182, 224, 182, 1186, 182, 224, 224, 595, + 1188, 403, 182, 235, 182, 1190, 182, 182, 182, 182, + 267, 182, 265, 182, 265, 224, 265, 265, 265, 265, + 300, 1193, 1029, 1071, 2443, 265, 265, 267, 789, 265, + 182, 182, 1072, 182, 235, 182, 182, 182, 1194, 182, + + 235, 182, 1195, 235, 235, 235, 249, 235, 1206, 402, + 1200, 403, 1201, 1199, 249, 267, 265, 265, 182, 182, + 1198, 182, 265, 182, 265, 249, 265, 265, 265, 265, + 249, 1209, 1034, 249, 1205, 265, 265, 267, 249, 265, + 670, 182, 182, 1204, 182, 249, 182, 1210, 1207, 249, + 1211, 268, 268, 268, 1212, 1233, 182, 182, 1239, 182, + 595, 182, 403, 268, 183, 1234, 265, 265, 182, 182, + 1232, 182, 265, 182, 265, 267, 265, 265, 265, 265, + 285, 856, 268, 268, 285, 265, 265, 267, 1244, 265, + 401, 401, 285, 401, 268, 401, 671, 1235, 1243, 2417, + + 1237, 182, 182, 1238, 182, 268, 182, 1246, 285, 597, + 1240, 598, 285, 1151, 1245, 1151, 265, 265, 182, 182, + 267, 182, 182, 182, 182, 1248, 182, 182, 182, 182, + 182, 1254, 182, 285, 304, 182, 182, 183, 1250, 182, + 681, 851, 182, 182, 285, 182, 1600, 182, 300, 1276, + 285, 182, 182, 1249, 182, 1251, 182, 182, 304, 182, + 1275, 652, 304, 455, 1259, 235, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 300, 182, 182, 182, 182, + 1273, 182, 182, 182, 182, 182, 182, 183, 304, 182, + 845, 913, 182, 182, 304, 182, 682, 182, 1274, 300, + + 300, 182, 182, 183, 182, 1278, 182, 182, 1266, 182, + 1356, 454, 182, 455, 182, 1261, 182, 182, 299, 182, + 267, 182, 299, 299, 299, 300, 299, 299, 299, 299, + 300, 1262, 335, 304, 1037, 299, 299, 300, 1280, 299, + 182, 182, 978, 182, 978, 182, 304, 182, 1260, 182, + 1301, 182, 182, 304, 182, 1279, 182, 183, 1281, 652, + 1080, 455, 182, 1565, 182, 300, 299, 299, 299, 182, + 334, 182, 299, 299, 299, 335, 299, 299, 299, 299, + 300, 182, 1095, 182, 1307, 299, 299, 300, 1268, 299, + 711, 393, 393, 335, 393, 2408, 393, 1302, 335, 300, + + 1303, 1265, 978, 357, 978, 1314, 182, 182, 1263, 182, + 654, 182, 655, 182, 1360, 182, 299, 299, 299, 182, + 1270, 182, 299, 299, 299, 267, 299, 299, 299, 299, + 201, 300, 857, 335, 357, 299, 299, 300, 335, 299, + 1264, 1389, 335, 1308, 182, 182, 712, 182, 1304, 182, + 182, 182, 1312, 182, 235, 182, 335, 182, 182, 1306, + 182, 1309, 182, 334, 201, 1583, 299, 299, 326, 657, + 326, 463, 326, 326, 326, 326, 462, 735, 463, 736, + 357, 326, 326, 326, 1313, 326, 182, 182, 182, 182, + 182, 182, 2398, 357, 357, 357, 401, 401, 847, 401, + + 1319, 401, 1318, 183, 722, 657, 300, 463, 182, 1315, + 182, 1350, 326, 326, 326, 659, 326, 660, 326, 326, + 326, 326, 357, 1267, 201, 357, 300, 326, 326, 326, + 1320, 326, 201, 182, 182, 1269, 182, 523, 182, 1317, + 201, 201, 1321, 186, 1322, 1331, 1168, 1323, 182, 182, + 1324, 182, 267, 182, 186, 849, 2389, 201, 326, 326, + 182, 182, 1325, 182, 332, 182, 332, 334, 332, 332, + 332, 332, 1329, 186, 186, 1357, 912, 332, 332, 334, + 186, 332, 299, 182, 1330, 182, 186, 299, 1332, 183, + 2380, 1334, 186, 182, 182, 1335, 182, 1336, 182, 186, + + 1363, 692, 183, 495, 1337, 1349, 1352, 201, 332, 332, + 182, 182, 334, 182, 332, 182, 332, 183, 332, 332, + 332, 332, 183, 1371, 1097, 1351, 183, 332, 332, 334, + 881, 332, 741, 299, 182, 1354, 182, 201, 299, 201, + 224, 1372, 224, 1355, 1379, 224, 1390, 1380, 182, 182, + 235, 182, 494, 182, 495, 224, 2371, 1381, 332, 332, + 182, 182, 1361, 182, 332, 182, 332, 334, 332, 332, + 332, 332, 224, 1378, 914, 224, 1362, 332, 332, 334, + 201, 332, 299, 182, 1384, 182, 224, 299, 742, 1383, + 1364, 1385, 224, 182, 182, 1576, 182, 1386, 182, 235, + + 1398, 692, 201, 495, 1365, 2367, 1397, 1401, 332, 332, + 182, 182, 334, 182, 182, 182, 182, 235, 182, 182, + 358, 182, 235, 249, 1396, 1388, 1105, 182, 182, 183, + 201, 182, 753, 493, 393, 1402, 393, 235, 493, 1408, + 249, 268, 249, 1361, 1409, 1442, 285, 183, 182, 182, + 1455, 182, 694, 182, 695, 249, 1754, 1362, 182, 182, + 182, 182, 1373, 182, 182, 182, 182, 334, 182, 182, + 358, 182, 1410, 918, 1432, 1444, 1374, 182, 182, 183, + 235, 182, 299, 182, 1434, 182, 1456, 299, 754, 1441, + 268, 268, 249, 978, 978, 268, 978, 1448, 978, 2359, + + 1481, 502, 201, 503, 285, 268, 285, 304, 182, 182, + 182, 182, 1108, 182, 182, 182, 182, 201, 182, 182, + 182, 182, 201, 201, 201, 201, 201, 182, 182, 183, + 370, 182, 608, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 182, 182, + 182, 182, 1364, 182, 182, 182, 182, 1447, 182, 182, + 182, 182, 1491, 1515, 2341, 1454, 1365, 182, 182, 183, + 335, 182, 775, 285, 299, 182, 1373, 182, 1366, 299, + 1367, 285, 304, 182, 182, 1368, 182, 1529, 182, 235, + + 1374, 1479, 1369, 698, 357, 503, 1370, 201, 182, 182, + 182, 182, 267, 182, 182, 182, 182, 304, 182, 182, + 182, 182, 1151, 235, 1151, 1488, 304, 182, 182, 183, + 1489, 182, 884, 1028, 299, 182, 1361, 182, 776, 299, + 1254, 304, 183, 182, 182, 1540, 182, 2331, 182, 1151, + 1362, 1151, 335, 698, 1525, 503, 1523, 1513, 182, 182, + 199, 199, 267, 199, 199, 199, 199, 1460, 199, 199, + 199, 199, 1364, 335, 335, 1537, 249, 199, 199, 200, + 1219, 199, 501, 401, 1522, 401, 1365, 501, 182, 182, + 1373, 182, 357, 182, 1341, 357, 1536, 370, 1544, 2258, + + 335, 700, 186, 701, 1374, 186, 1551, 334, 199, 199, + 182, 182, 249, 182, 202, 182, 202, 1539, 202, 202, + 202, 202, 1361, 1557, 1102, 1552, 1528, 202, 202, 203, + 249, 204, 182, 182, 1364, 182, 1433, 182, 182, 182, + 1535, 182, 357, 182, 183, 186, 1578, 201, 1435, 1580, + 201, 723, 1568, 526, 183, 201, 357, 267, 202, 202, + 182, 182, 268, 182, 182, 182, 182, 1582, 182, 182, + 182, 182, 1373, 1218, 268, 183, 1543, 182, 182, 183, + 907, 182, 182, 182, 1361, 182, 1443, 182, 182, 182, + 1364, 182, 186, 182, 1586, 201, 1590, 1567, 1362, 183, + + 224, 525, 201, 526, 1365, 1563, 1564, 267, 182, 800, + 182, 182, 268, 182, 182, 182, 182, 1581, 182, 182, + 182, 182, 1373, 1220, 285, 2247, 1361, 182, 182, 183, + 285, 182, 182, 182, 249, 182, 1374, 182, 182, 182, + 1362, 182, 1589, 182, 224, 801, 224, 1588, 1602, 1614, + 370, 723, 235, 526, 182, 224, 182, 267, 182, 182, + 182, 182, 285, 182, 182, 182, 182, 1596, 182, 182, + 182, 182, 300, 1550, 182, 1468, 182, 182, 182, 183, + 224, 182, 393, 393, 1603, 393, 1604, 393, 1391, 186, + 1392, 802, 300, 978, 978, 1393, 978, 249, 978, 1617, + + 1469, 725, 1394, 726, 235, 235, 1395, 235, 182, 182, + 182, 182, 1040, 182, 182, 182, 182, 224, 182, 182, + 182, 182, 225, 225, 225, 225, 225, 182, 226, 183, + 224, 182, 812, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 182, 182, + 182, 182, 2220, 182, 182, 182, 182, 235, 182, 182, + 182, 182, 236, 236, 236, 236, 236, 182, 226, 183, + 235, 182, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 823, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 235, 182, 182, + 182, 182, 183, 182, 182, 182, 182, 1753, 182, 182, + 182, 182, 182, 224, 182, 1152, 183, 182, 182, 183, + 1597, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 300, 182, 1566, 182, 182, 834, 182, 268, 1470, 1646, + 1598, 728, 300, 534, 182, 1608, 182, 267, 182, 182, + 182, 182, 300, 182, 182, 182, 182, 224, 182, 182, + 182, 182, 300, 235, 1226, 2066, 1575, 182, 182, 183, + 909, 182, 182, 182, 1577, 182, 1927, 182, 1403, 1471, + 1404, 835, 183, 978, 978, 1405, 978, 1607, 978, 201, + + 183, 533, 1406, 534, 235, 1605, 1407, 249, 182, 182, + 182, 182, 1229, 182, 269, 182, 269, 1609, 269, 269, + 269, 269, 235, 2266, 182, 1610, 182, 269, 269, 270, + 1606, 271, 182, 182, 235, 182, 235, 182, 182, 182, + 182, 182, 300, 401, 401, 235, 401, 249, 401, 182, + 182, 728, 182, 534, 182, 249, 300, 300, 269, 269, + 182, 182, 730, 182, 731, 182, 1473, 268, 334, 1361, + 1618, 911, 182, 182, 1436, 182, 1437, 182, 1472, 267, + 2053, 1438, 1643, 1480, 182, 182, 853, 182, 1439, 182, + 854, 334, 1440, 268, 1361, 855, 182, 182, 919, 182, + + 265, 182, 265, 267, 265, 265, 265, 265, 1362, 304, + 183, 1030, 1585, 265, 265, 267, 1364, 265, 182, 1364, + 182, 182, 182, 182, 182, 182, 182, 1615, 183, 2033, + 1365, 249, 183, 1482, 182, 182, 300, 182, 1644, 182, + 267, 300, 268, 1475, 265, 858, 182, 182, 1033, 182, + 265, 182, 265, 267, 265, 265, 265, 265, 249, 304, + 268, 1038, 1474, 265, 265, 267, 2107, 265, 182, 182, + 1619, 182, 1373, 182, 1361, 1647, 1361, 224, 1364, 182, + 182, 859, 182, 285, 182, 1658, 1490, 334, 1362, 1373, + 1514, 978, 1516, 978, 265, 265, 182, 182, 267, 182, + + 265, 182, 265, 1524, 265, 265, 265, 265, 1096, 1270, + 285, 224, 304, 265, 265, 267, 335, 265, 335, 1224, + 1758, 182, 182, 2012, 182, 1655, 182, 860, 1361, 335, + 249, 1620, 1622, 249, 182, 182, 183, 182, 1476, 182, + 334, 304, 1362, 1688, 265, 265, 182, 182, 1098, 182, + 182, 182, 182, 334, 182, 182, 182, 182, 268, 1364, + 285, 1101, 1779, 182, 182, 183, 1373, 182, 357, 224, + 1648, 182, 182, 1365, 182, 1659, 182, 268, 1649, 1364, + 1374, 870, 183, 370, 182, 182, 335, 182, 1717, 182, + 334, 1651, 268, 1365, 182, 182, 182, 182, 1106, 182, + + 182, 182, 182, 267, 182, 182, 182, 182, 1656, 1221, + 1775, 1373, 285, 182, 182, 183, 224, 182, 978, 978, + 1999, 978, 1364, 978, 1449, 1374, 1450, 871, 285, 182, + 182, 1451, 182, 224, 182, 370, 1365, 1154, 1452, 1155, + 1660, 304, 1453, 285, 182, 182, 302, 199, 334, 199, + 302, 302, 302, 1690, 302, 302, 302, 302, 1373, 285, + 1661, 304, 357, 302, 302, 303, 1288, 302, 978, 978, + 1361, 978, 1374, 978, 182, 182, 1685, 182, 1364, 182, + 1663, 285, 1686, 357, 1362, 1729, 304, 1215, 304, 1216, + 304, 1691, 1365, 267, 302, 302, 299, 182, 357, 182, + + 305, 299, 305, 1689, 305, 305, 305, 305, 1715, 182, + 186, 182, 335, 305, 305, 306, 1227, 307, 186, 1373, + 182, 182, 1483, 182, 1484, 182, 335, 300, 335, 1485, + 1693, 304, 186, 1374, 1742, 182, 1486, 182, 1719, 267, + 1487, 304, 1575, 1714, 305, 305, 299, 182, 1222, 182, + 299, 299, 299, 300, 299, 299, 299, 299, 183, 186, + 182, 335, 182, 299, 299, 300, 1373, 299, 1572, 1572, + 182, 182, 1517, 182, 1518, 182, 1718, 1727, 300, 1519, + 1374, 357, 1573, 1573, 1674, 1675, 1520, 1574, 1601, 267, + 1521, 335, 201, 357, 299, 895, 299, 182, 1223, 182, + + 299, 299, 299, 224, 299, 299, 299, 299, 1726, 1530, + 357, 1531, 235, 299, 299, 300, 1532, 299, 182, 1572, + 182, 182, 182, 1533, 182, 1730, 182, 1534, 357, 335, + 1720, 896, 235, 1573, 182, 182, 300, 182, 1613, 182, + 267, 1959, 1676, 249, 299, 299, 299, 182, 1225, 182, + 299, 299, 299, 267, 299, 299, 299, 299, 1151, 186, + 1151, 1572, 1228, 299, 299, 300, 183, 299, 182, 182, + 357, 182, 1563, 182, 1739, 1641, 1460, 897, 182, 182, + 1642, 182, 1731, 182, 201, 268, 1762, 267, 182, 182, + 1031, 182, 1979, 182, 299, 299, 326, 267, 326, 1032, + + 326, 326, 326, 326, 1035, 1668, 1577, 334, 1036, 326, + 326, 326, 186, 326, 1103, 1722, 335, 186, 1104, 329, + 182, 182, 183, 182, 1931, 182, 182, 1743, 182, 1744, + 182, 182, 201, 182, 1764, 182, 182, 201, 182, 334, + 326, 326, 182, 182, 300, 182, 336, 182, 336, 334, + 336, 336, 336, 336, 300, 1287, 357, 1732, 1572, 336, + 336, 337, 1679, 338, 235, 182, 182, 1795, 182, 1784, + 182, 182, 1573, 1575, 1734, 357, 182, 1654, 182, 235, + 1079, 978, 285, 978, 334, 1079, 182, 1099, 182, 300, + 336, 336, 182, 182, 300, 182, 1100, 182, 1572, 1256, + + 183, 1257, 978, 978, 300, 978, 1545, 978, 1546, 1939, + 1677, 334, 1573, 1547, 183, 1740, 1572, 1752, 915, 186, + 1548, 1284, 916, 1285, 1549, 186, 1678, 917, 182, 182, + 1683, 182, 332, 182, 332, 1684, 332, 332, 332, 332, + 304, 1769, 182, 979, 1577, 332, 332, 334, 1572, 332, + 182, 182, 182, 182, 1585, 182, 182, 182, 201, 182, + 300, 182, 1712, 186, 1745, 1747, 186, 1713, 1796, 334, + 300, 1772, 335, 201, 1763, 334, 332, 920, 182, 182, + 235, 182, 332, 182, 332, 1289, 332, 332, 332, 332, + 224, 1770, 1295, 183, 1759, 332, 332, 334, 1765, 332, + + 182, 182, 201, 182, 1585, 182, 1760, 1761, 201, 1766, + 201, 182, 182, 921, 182, 1767, 182, 201, 1774, 334, + 183, 201, 224, 1776, 1777, 1290, 332, 332, 182, 182, + 334, 182, 332, 182, 332, 1768, 332, 332, 332, 332, + 1778, 224, 224, 201, 224, 332, 332, 334, 1572, 332, + 1572, 1293, 182, 182, 1591, 182, 1592, 182, 235, 922, + 1792, 1593, 1573, 235, 1573, 1788, 1781, 1773, 1594, 1725, + 224, 334, 1595, 183, 357, 1780, 332, 332, 182, 182, + 1291, 182, 182, 182, 182, 224, 182, 182, 358, 182, + 182, 224, 1572, 224, 235, 182, 182, 183, 1782, 182, + + 1789, 235, 182, 182, 182, 182, 1573, 182, 1790, 201, + 183, 1738, 1785, 932, 1735, 249, 186, 1802, 224, 235, + 1791, 334, 1922, 235, 1786, 1787, 182, 182, 182, 182, + 1292, 182, 182, 182, 182, 183, 182, 182, 358, 182, + 1793, 235, 249, 1803, 1806, 182, 182, 183, 1794, 182, + 1799, 235, 249, 182, 182, 249, 182, 1804, 182, 933, + 1805, 1807, 1800, 1801, 249, 1808, 249, 249, 268, 268, + 1823, 1825, 334, 249, 268, 1824, 182, 182, 182, 182, + 1294, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 182, 182, 183, 370, 182, + + 201, 370, 370, 370, 370, 370, 370, 370, 370, 943, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 1934, 182, 182, 182, 182, 1809, 182, 182, 182, 182, + 1826, 1810, 1828, 201, 268, 182, 182, 183, 268, 182, + 182, 182, 249, 182, 1820, 182, 978, 978, 249, 978, + 1827, 978, 183, 951, 1829, 1842, 1821, 1822, 268, 334, + 268, 285, 268, 1830, 1831, 1108, 182, 182, 182, 182, + 201, 182, 182, 182, 182, 1937, 182, 182, 182, 182, + 268, 268, 1296, 285, 1838, 182, 182, 183, 1834, 182, + + 1746, 1844, 182, 182, 285, 182, 1837, 182, 1840, 952, + 1835, 1836, 285, 285, 285, 1839, 1841, 1843, 285, 183, + 304, 334, 1859, 1845, 285, 285, 182, 182, 182, 182, + 1297, 182, 393, 182, 393, 1921, 393, 393, 393, 393, + 285, 304, 182, 1861, 182, 393, 393, 394, 2119, 395, + 978, 978, 182, 978, 182, 978, 182, 182, 1938, 182, + 300, 182, 182, 1863, 182, 1851, 304, 1860, 235, 1298, + 300, 304, 182, 201, 182, 267, 393, 393, 199, 199, + 300, 199, 199, 199, 199, 1864, 199, 199, 199, 199, + 300, 304, 1424, 1866, 1862, 199, 199, 200, 304, 199, + + 978, 978, 182, 978, 1758, 978, 182, 182, 1865, 182, + 304, 182, 335, 1867, 1880, 1884, 304, 335, 1881, 1339, + 300, 1340, 335, 335, 1882, 267, 199, 963, 182, 182, + 304, 182, 202, 182, 202, 1885, 202, 202, 202, 202, + 182, 335, 182, 1887, 1883, 202, 202, 203, 335, 204, + 978, 978, 1856, 978, 1886, 978, 182, 182, 300, 182, + 335, 182, 335, 1888, 1857, 1858, 1897, 1852, 304, 1154, + 357, 1155, 182, 1741, 182, 267, 202, 964, 182, 182, + 335, 182, 401, 182, 401, 1901, 401, 401, 401, 401, + 300, 357, 357, 1894, 1896, 401, 401, 402, 1898, 403, + + 978, 978, 357, 978, 1899, 978, 357, 1850, 357, 1895, + 357, 182, 182, 1911, 182, 1900, 182, 186, 1902, 1342, + 186, 1155, 1908, 357, 186, 1909, 401, 401, 182, 182, + 267, 182, 182, 182, 182, 357, 182, 182, 182, 182, + 186, 1915, 1910, 224, 1948, 182, 182, 183, 1925, 182, + 1153, 1153, 1425, 1153, 1877, 1153, 182, 182, 186, 182, + 1912, 182, 201, 1926, 980, 1914, 1878, 1879, 186, 1344, + 335, 1345, 1733, 186, 1913, 267, 182, 182, 182, 182, + 186, 182, 182, 182, 182, 1916, 182, 182, 182, 182, + 1758, 201, 1932, 1928, 1933, 182, 182, 183, 201, 182, + + 978, 978, 186, 978, 1728, 978, 183, 981, 224, 201, + 224, 182, 182, 1941, 182, 224, 182, 1945, 224, 1347, + 1949, 1348, 1947, 224, 1946, 1721, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 991, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 1716, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 1002, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 1942, 182, 182, 182, 182, 183, 182, 182, 182, 182, + 1952, 224, 1943, 1944, 2082, 182, 182, 183, 1929, 182, + 978, 978, 224, 978, 1891, 978, 978, 978, 235, 978, + 1951, 978, 1930, 224, 1013, 1955, 1892, 1893, 1958, 1412, + 357, 1413, 1950, 224, 235, 1229, 182, 182, 182, 182, + 1935, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 1953, 1956, 186, 2068, 1936, 182, 182, 183, 235, 182, + + 978, 978, 224, 978, 1429, 978, 1957, 1014, 1961, 1960, + 1929, 182, 182, 235, 182, 235, 182, 201, 235, 1215, + 235, 1216, 2574, 1962, 1930, 1964, 182, 182, 182, 182, + 334, 182, 453, 182, 453, 1963, 453, 453, 453, 453, + 235, 235, 224, 249, 1935, 453, 453, 454, 1977, 455, + 978, 978, 1905, 978, 1965, 978, 182, 182, 1936, 182, + 235, 182, 235, 1692, 1906, 1907, 1975, 1966, 186, 1414, + 249, 1216, 1971, 1974, 235, 334, 453, 453, 182, 182, + 1929, 182, 269, 182, 269, 249, 269, 269, 269, 269, + 249, 2278, 1505, 1969, 1930, 269, 269, 270, 1978, 271, + + 1153, 1153, 249, 1153, 1972, 1153, 1935, 249, 1970, 1973, + 1976, 182, 182, 249, 182, 268, 182, 249, 1993, 1416, + 1936, 1417, 249, 249, 186, 2079, 269, 1025, 182, 182, + 334, 182, 461, 182, 461, 268, 461, 461, 461, 461, + 268, 1989, 1990, 249, 1687, 461, 461, 462, 1987, 463, + 978, 978, 1506, 978, 268, 978, 182, 182, 2074, 182, + 1992, 182, 268, 1988, 1994, 268, 201, 2087, 268, 1419, + 1997, 1420, 1995, 268, 186, 334, 461, 461, 182, 182, + 1929, 182, 265, 182, 265, 268, 265, 265, 265, 265, + 285, 2004, 2005, 1998, 1991, 265, 265, 267, 1935, 265, + + 182, 182, 2006, 182, 285, 182, 182, 182, 268, 182, + 2009, 182, 1996, 2007, 1041, 285, 2008, 268, 186, 267, + 285, 2072, 1421, 285, 2027, 267, 265, 265, 182, 182, + 285, 182, 265, 182, 265, 268, 265, 265, 265, 265, + 304, 304, 2024, 1662, 2011, 265, 265, 267, 2002, 265, + 285, 2023, 2026, 182, 182, 2010, 182, 1042, 182, 285, + 2029, 1929, 285, 2003, 304, 304, 182, 182, 2332, 182, + 2028, 182, 267, 304, 304, 1930, 265, 265, 182, 182, + 1422, 182, 182, 182, 182, 267, 182, 182, 182, 182, + 182, 186, 182, 1423, 2032, 182, 182, 183, 285, 182, + + 2043, 2021, 182, 182, 1935, 182, 1929, 182, 300, 304, + 335, 1935, 2044, 335, 1052, 304, 2022, 182, 1936, 182, + 2025, 267, 201, 2089, 2017, 2030, 182, 182, 182, 182, + 1426, 182, 182, 182, 182, 300, 182, 182, 182, 182, + 182, 285, 182, 304, 1657, 182, 182, 183, 304, 182, + 182, 182, 2090, 182, 978, 182, 978, 1053, 300, 2041, + 304, 182, 182, 2048, 182, 2031, 182, 335, 183, 267, + 2018, 1929, 1080, 335, 2042, 2047, 182, 182, 299, 182, + 334, 182, 493, 299, 493, 2045, 493, 493, 493, 493, + 1427, 2075, 335, 2046, 186, 493, 493, 494, 2049, 495, + + 2058, 1508, 1650, 2052, 182, 182, 335, 182, 335, 182, + 335, 335, 357, 357, 2059, 2051, 182, 182, 335, 182, + 357, 182, 1645, 267, 2061, 2064, 493, 493, 302, 199, + 1428, 199, 302, 302, 302, 334, 302, 302, 302, 302, + 2062, 357, 1621, 1503, 357, 302, 302, 303, 1935, 302, + 1079, 978, 2056, 978, 1929, 1079, 978, 978, 2067, 978, + 2060, 978, 2050, 2084, 186, 2085, 357, 2057, 1930, 1458, + 1616, 1459, 201, 357, 201, 1298, 302, 1064, 299, 182, + 2063, 182, 305, 299, 305, 335, 305, 305, 305, 305, + 201, 357, 2288, 357, 2088, 305, 305, 306, 1935, 307, + + 1079, 978, 2065, 978, 1510, 1079, 182, 182, 2071, 182, + 2073, 182, 1936, 183, 2093, 201, 285, 357, 186, 1256, + 186, 1257, 186, 2083, 2077, 267, 305, 1065, 299, 182, + 1929, 182, 501, 299, 501, 357, 501, 501, 501, 501, + 2123, 1635, 2076, 235, 1930, 501, 501, 502, 1929, 503, + 1079, 978, 2069, 978, 186, 1079, 182, 182, 1935, 182, + 2098, 182, 1930, 186, 183, 186, 186, 2070, 2216, 1461, + 201, 1257, 1936, 201, 2094, 267, 501, 501, 299, 182, + 2135, 182, 299, 299, 299, 201, 299, 299, 299, 299, + 249, 2099, 2095, 2092, 186, 299, 299, 300, 2096, 299, + + 1255, 1153, 201, 1153, 1935, 1255, 182, 182, 183, 182, + 1584, 182, 2097, 224, 1081, 2100, 224, 224, 1936, 1463, + 183, 1464, 224, 2101, 2110, 267, 299, 299, 299, 182, + 2105, 182, 299, 299, 299, 201, 299, 299, 299, 299, + 2241, 2104, 1929, 224, 2102, 299, 299, 300, 224, 299, + 1079, 978, 224, 978, 2111, 1079, 1930, 1082, 2106, 2103, + 2109, 182, 182, 224, 182, 224, 182, 224, 224, 1466, + 2108, 1467, 2113, 224, 235, 1579, 299, 299, 182, 182, + 267, 182, 524, 182, 524, 224, 524, 524, 524, 524, + 2114, 2112, 235, 249, 2128, 524, 524, 525, 183, 526, + + 978, 978, 1636, 978, 1935, 978, 182, 182, 2115, 1575, + 235, 182, 235, 235, 235, 235, 2121, 235, 1936, 1493, + 2116, 1494, 2118, 2227, 2117, 267, 524, 524, 182, 182, + 2124, 182, 336, 182, 336, 224, 336, 336, 336, 336, + 2120, 201, 235, 2147, 235, 336, 336, 337, 2127, 338, + 978, 978, 2122, 978, 2125, 978, 182, 182, 2126, 1577, + 2096, 182, 249, 249, 249, 249, 2130, 249, 2129, 1284, + 268, 1285, 2133, 249, 2097, 267, 336, 1093, 182, 182, + 183, 182, 532, 182, 532, 2132, 532, 532, 532, 532, + 235, 249, 2134, 2160, 249, 532, 532, 533, 2096, 534, + + 978, 978, 249, 978, 2141, 978, 182, 182, 2136, 1585, + 2143, 182, 2097, 268, 2142, 268, 2144, 2562, 268, 1495, + 285, 1285, 2145, 268, 268, 267, 532, 532, 182, 182, + 2096, 182, 332, 182, 332, 249, 332, 332, 332, 332, + 268, 2146, 186, 2148, 2151, 332, 332, 334, 2152, 332, + 1153, 1153, 268, 1153, 268, 1153, 182, 182, 268, 182, + 2153, 182, 2149, 268, 1109, 268, 2150, 268, 183, 1497, + 285, 1498, 285, 2157, 2158, 334, 332, 332, 182, 182, + 2224, 182, 332, 182, 332, 2154, 332, 332, 332, 332, + 2156, 285, 2159, 2155, 285, 332, 332, 334, 2176, 332, + + 978, 978, 285, 978, 285, 978, 2161, 1110, 2162, 285, + 2164, 182, 182, 2181, 182, 285, 182, 285, 2163, 1500, + 285, 1501, 1151, 304, 1151, 304, 332, 332, 182, 182, + 334, 182, 182, 182, 182, 285, 182, 182, 358, 182, + 1254, 2165, 182, 2170, 182, 182, 182, 183, 2096, 182, + 182, 182, 304, 182, 2171, 182, 182, 182, 183, 182, + 300, 182, 2097, 304, 1120, 304, 2172, 304, 2173, 334, + 2169, 2182, 1502, 304, 2175, 334, 182, 182, 182, 182, + 304, 182, 182, 182, 182, 285, 182, 182, 358, 182, + 2242, 1706, 182, 224, 182, 182, 182, 183, 304, 182, + + 2177, 335, 2174, 182, 182, 2191, 182, 1121, 182, 304, + 300, 2178, 304, 304, 2179, 2187, 2188, 335, 2190, 2168, + 335, 2192, 334, 1382, 335, 335, 182, 182, 182, 182, + 1504, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 182, 182, 183, 370, 182, + 201, 370, 370, 370, 370, 370, 370, 1131, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 2096, 182, 182, 182, 182, 1377, 182, 182, 182, 182, + 182, 182, 2090, 2095, 2180, 182, 182, 183, 2189, 182, + + 357, 2194, 182, 182, 2204, 182, 2096, 182, 300, 300, + 335, 2214, 335, 2193, 1139, 2195, 335, 304, 335, 2196, + 2197, 334, 357, 2203, 186, 2198, 182, 182, 182, 182, + 1507, 182, 182, 182, 182, 335, 182, 182, 182, 182, + 335, 2200, 335, 335, 2201, 182, 182, 183, 2199, 182, + 357, 978, 978, 357, 978, 2207, 978, 1140, 2210, 2202, + 357, 2205, 2248, 2206, 357, 224, 182, 182, 357, 182, + 1339, 182, 1340, 357, 2208, 357, 182, 182, 182, 182, + 2255, 182, 393, 182, 393, 334, 393, 393, 393, 393, + 357, 235, 1509, 357, 2209, 393, 393, 394, 2096, 395, + + 978, 978, 357, 978, 2090, 978, 182, 182, 2211, 182, + 2212, 182, 2097, 186, 2213, 2215, 2219, 183, 186, 1553, + 183, 1340, 186, 186, 186, 334, 393, 1150, 182, 182, + 2223, 182, 401, 182, 401, 357, 401, 401, 401, 401, + 186, 186, 2217, 2221, 183, 401, 401, 402, 2222, 403, + 1338, 1338, 2226, 1338, 2096, 1338, 201, 186, 2225, 2228, + 201, 182, 182, 201, 182, 2234, 182, 2240, 2097, 1555, + 2251, 1556, 201, 201, 224, 2095, 401, 1156, 182, 182, + 334, 182, 182, 182, 182, 2235, 182, 182, 182, 182, + 186, 183, 2239, 2229, 2238, 182, 182, 183, 201, 182, + + 1169, 2257, 1707, 978, 978, 2243, 978, 2230, 978, 201, + 183, 2231, 235, 224, 2253, 224, 182, 182, 235, 182, + 2249, 182, 1342, 183, 1155, 2232, 182, 182, 182, 182, + 201, 182, 182, 182, 182, 267, 182, 182, 182, 182, + 2096, 1632, 1633, 235, 2261, 182, 182, 183, 201, 182, + 1170, 1558, 978, 978, 2097, 978, 183, 978, 224, 224, + 224, 182, 182, 224, 1575, 2244, 182, 2246, 235, 2245, + 2250, 1154, 235, 1155, 2256, 2254, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 1180, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 1341, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + 1191, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 2096, 182, 182, 182, 182, 2262, 182, 182, 182, 182, + 249, 224, 2259, 2236, 2097, 182, 182, 183, 235, 182, + + 1202, 978, 978, 2252, 978, 2260, 978, 2237, 2263, 2437, + 2229, 224, 249, 2265, 249, 235, 182, 182, 2267, 182, + 1342, 182, 1155, 201, 2230, 249, 182, 182, 182, 182, + 201, 182, 182, 182, 182, 267, 182, 182, 182, 182, + 235, 1634, 2264, 2231, 2236, 182, 182, 183, 2269, 182, + 1203, 1153, 1153, 2270, 1153, 2268, 1153, 2232, 2237, 249, + 249, 2229, 2275, 268, 1152, 249, 182, 182, 249, 182, + 1344, 182, 1345, 235, 235, 2230, 182, 182, 182, 182, + 2231, 182, 453, 182, 453, 267, 453, 453, 453, 453, + 2287, 285, 1333, 1637, 2232, 453, 453, 454, 249, 455, + + 978, 978, 2274, 978, 2236, 978, 182, 182, 2272, 1577, + 2273, 182, 2285, 268, 268, 2279, 285, 249, 2237, 1347, + 268, 1348, 268, 2282, 2286, 334, 453, 1213, 182, 182, + 2229, 182, 461, 182, 461, 2338, 461, 461, 461, 461, + 268, 249, 285, 201, 2276, 461, 461, 462, 2231, 463, + 978, 978, 2280, 978, 2236, 978, 182, 182, 2283, 1585, + 2290, 182, 2277, 2289, 268, 268, 2229, 268, 2281, 1559, + 285, 1348, 224, 285, 2352, 334, 461, 1217, 182, 182, + 2230, 182, 265, 182, 265, 268, 265, 265, 265, 265, + 2291, 268, 182, 2284, 182, 265, 265, 267, 285, 265, + + 1230, 1346, 1346, 285, 1346, 2295, 1346, 285, 2292, 304, + 300, 2231, 2296, 2294, 285, 1175, 182, 182, 304, 182, + 1561, 182, 1562, 2297, 304, 2232, 265, 265, 182, 182, + 304, 182, 265, 182, 265, 334, 265, 265, 265, 265, + 2300, 1703, 1704, 2236, 2309, 265, 265, 267, 285, 265, + 1231, 978, 978, 2301, 978, 2302, 978, 2237, 2307, 2305, + 304, 2229, 335, 335, 304, 304, 182, 182, 304, 182, + 1412, 182, 1413, 2310, 335, 2298, 265, 265, 182, 182, + 285, 182, 182, 182, 182, 334, 182, 182, 182, 182, + 182, 1705, 2238, 2304, 2313, 182, 182, 183, 304, 182, + + 1241, 978, 978, 2308, 978, 2368, 978, 335, 300, 2318, + 304, 2231, 182, 249, 182, 335, 182, 182, 335, 182, + 1623, 182, 1413, 2317, 2326, 2299, 182, 182, 182, 182, + 300, 182, 182, 182, 182, 334, 182, 182, 182, 182, + 335, 357, 2293, 1708, 2315, 182, 182, 183, 304, 182, + 1242, 1338, 1338, 2314, 1338, 2320, 1338, 335, 2319, 357, + 335, 2236, 2334, 357, 2322, 357, 182, 182, 2323, 182, + 1625, 182, 1626, 2321, 186, 2303, 182, 182, 299, 182, + 2229, 182, 493, 299, 493, 267, 493, 493, 493, 493, + 2329, 357, 357, 186, 2311, 493, 493, 494, 304, 495, + + 978, 978, 1814, 978, 2231, 978, 182, 182, 2324, 182, + 2325, 182, 2328, 2440, 2327, 357, 186, 335, 2312, 1414, + 357, 1216, 201, 357, 2335, 267, 493, 1252, 299, 182, + 1815, 182, 501, 299, 501, 2330, 501, 501, 501, 501, + 186, 335, 224, 2351, 1316, 501, 501, 502, 1627, 503, + 978, 978, 186, 978, 2236, 978, 182, 182, 2229, 182, + 2336, 182, 2339, 183, 2333, 186, 2229, 201, 2316, 1215, + 186, 1216, 2230, 2337, 2342, 267, 501, 1258, 299, 182, + 2230, 182, 299, 299, 299, 1305, 299, 299, 299, 299, + 183, 335, 2340, 2231, 186, 299, 299, 300, 201, 299, + + 1271, 978, 978, 357, 978, 2346, 978, 2232, 2343, 2349, + 224, 2236, 2356, 224, 201, 2354, 182, 182, 201, 182, + 1414, 182, 1216, 2347, 183, 2237, 299, 299, 299, 182, + 357, 182, 299, 299, 299, 267, 299, 299, 299, 299, + 2516, 201, 2348, 224, 1816, 299, 299, 300, 357, 299, + 1272, 1153, 1153, 2344, 1153, 2231, 1153, 2236, 183, 2229, + 2369, 182, 182, 2358, 182, 249, 182, 2345, 1277, 2232, + 1416, 2237, 1417, 2230, 224, 183, 299, 299, 182, 182, + 267, 182, 524, 182, 524, 2350, 524, 524, 524, 524, + 201, 186, 201, 186, 2231, 524, 524, 525, 2236, 526, + + 978, 978, 2238, 978, 2353, 978, 182, 182, 2232, 182, + 183, 182, 2237, 2357, 183, 1247, 224, 2355, 183, 1419, + 224, 1420, 2360, 235, 2364, 267, 524, 1282, 182, 182, + 235, 182, 532, 182, 532, 224, 532, 532, 532, 532, + 235, 235, 2361, 235, 2362, 532, 532, 533, 2363, 534, + 978, 978, 2365, 978, 2229, 978, 182, 182, 1236, 1758, + 2231, 182, 235, 235, 2366, 2374, 2370, 2379, 2230, 1628, + 249, 1420, 249, 268, 2232, 267, 532, 1286, 182, 182, + 2344, 182, 332, 182, 332, 224, 332, 332, 332, 332, + 2373, 224, 2372, 2236, 2345, 332, 332, 334, 1208, 332, + + 1299, 1346, 1346, 2344, 1346, 249, 1346, 2237, 249, 2388, + 235, 182, 182, 2377, 182, 285, 182, 2345, 2375, 1197, + 1630, 268, 1631, 2383, 224, 249, 332, 332, 182, 182, + 334, 182, 332, 182, 332, 1872, 332, 332, 332, 332, + 249, 268, 2382, 2378, 1192, 332, 332, 334, 268, 332, + 1300, 1079, 978, 2344, 978, 268, 1079, 2386, 2384, 1185, + 2390, 182, 182, 268, 182, 285, 182, 2381, 2385, 2387, + 1458, 2344, 1459, 285, 285, 268, 332, 332, 182, 182, + 334, 182, 182, 182, 182, 2345, 182, 182, 358, 182, + 268, 2391, 1175, 2392, 2400, 182, 182, 183, 285, 182, + + 1310, 1079, 978, 2393, 978, 2395, 1079, 304, 285, 285, + 285, 2410, 182, 304, 182, 2501, 182, 182, 2396, 182, + 1664, 182, 1459, 304, 335, 186, 182, 182, 182, 182, + 300, 182, 182, 182, 182, 334, 182, 182, 358, 182, + 2394, 182, 2397, 2342, 1873, 182, 182, 183, 304, 182, + 1311, 1457, 1338, 182, 1338, 2343, 1457, 2401, 2402, 300, + 2403, 182, 182, 304, 182, 2405, 182, 304, 1168, 2406, + 1666, 300, 1667, 335, 335, 304, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 182, 182, 183, 370, 182, + + 1170, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 2344, 182, 182, 182, 182, 2412, 182, 182, 182, 182, + 335, 182, 2407, 2348, 2399, 182, 182, 183, 335, 182, + 1327, 2426, 2411, 1079, 978, 2344, 978, 2414, 1079, 300, + 2418, 182, 182, 186, 182, 357, 182, 304, 2413, 2409, + 335, 979, 1461, 357, 1257, 335, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 2415, 182, 182, 182, 182, + 357, 2419, 335, 186, 2425, 182, 182, 183, 2416, 182, + + 1328, 1669, 1079, 978, 357, 978, 2344, 1079, 2420, 357, + 2421, 182, 182, 357, 1758, 2422, 182, 357, 2427, 2424, + 2345, 1256, 186, 1257, 186, 2342, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 186, 182, 182, 182, 182, + 2423, 183, 183, 357, 186, 182, 182, 183, 2428, 182, + 1079, 978, 186, 978, 2429, 1079, 182, 182, 2344, 182, + 186, 182, 2430, 2441, 224, 224, 224, 2442, 1358, 1461, + 2444, 1257, 2345, 1152, 2343, 334, 182, 182, 182, 182, + 201, 182, 182, 182, 182, 2433, 182, 182, 182, 182, + 183, 2344, 1871, 2436, 186, 182, 182, 183, 201, 182, + + 2438, 1255, 1153, 2348, 1153, 2345, 1255, 183, 2445, 183, + 1007, 182, 182, 201, 182, 224, 182, 224, 2447, 183, + 1463, 1359, 1464, 2448, 224, 979, 182, 182, 182, 182, + 267, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + 1376, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 335, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 1387, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 2431, 182, 182, 182, 182, 2502, 182, 182, 182, 182, + 327, 2439, 2446, 186, 2432, 182, 182, 183, 2434, 182, + 1079, 978, 201, 978, 224, 1079, 182, 182, 2450, 182, + 2452, 182, 2435, 2449, 235, 2451, 235, 201, 1399, 1466, + 235, 1467, 235, 2577, 235, 267, 182, 182, 182, 182, + 2431, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 2454, 1983, 235, 2344, 2432, 182, 182, 183, 2497, 182, + + 2455, 1079, 978, 2431, 978, 2434, 1079, 2345, 576, 2453, + 235, 182, 182, 235, 182, 186, 182, 2432, 249, 2435, + 1670, 1400, 1467, 575, 224, 2461, 182, 182, 182, 182, + 267, 182, 265, 182, 265, 235, 265, 265, 265, 265, + 249, 2456, 1984, 268, 2457, 265, 265, 267, 2434, 265, + 1465, 1346, 2458, 1346, 249, 1465, 978, 978, 249, 978, + 2512, 978, 2435, 2459, 2460, 249, 2431, 224, 1430, 1672, + 574, 1673, 2469, 249, 249, 1040, 265, 265, 182, 182, + 2462, 182, 265, 182, 265, 249, 265, 265, 265, 265, + 285, 2619, 2463, 2465, 186, 265, 265, 267, 2467, 265, + + 2466, 978, 978, 268, 978, 268, 978, 268, 2468, 268, + 2470, 182, 182, 268, 182, 2526, 182, 268, 201, 2505, + 1493, 1431, 1494, 285, 2473, 2475, 265, 265, 182, 182, + 334, 182, 182, 182, 182, 285, 182, 182, 182, 182, + 2471, 249, 182, 304, 182, 182, 182, 183, 2434, 182, + 978, 978, 2472, 978, 285, 978, 182, 182, 2474, 182, + 300, 182, 2464, 2514, 2482, 285, 2431, 285, 1445, 1694, + 224, 1494, 182, 304, 2436, 334, 182, 182, 182, 182, + 2432, 182, 182, 182, 182, 268, 182, 182, 182, 182, + 300, 2037, 2477, 2479, 2487, 182, 182, 183, 2481, 182, + + 2480, 1338, 1338, 285, 1338, 304, 1338, 304, 335, 304, + 2485, 182, 182, 304, 182, 2490, 182, 2483, 249, 2524, + 1696, 1446, 1697, 335, 335, 2491, 182, 182, 299, 182, + 334, 182, 299, 299, 299, 335, 299, 299, 299, 299, + 573, 2488, 2038, 357, 2493, 299, 299, 300, 2434, 299, + 978, 978, 2489, 978, 335, 978, 978, 978, 357, 978, + 2492, 978, 2435, 335, 2521, 2496, 2431, 570, 1477, 1495, + 235, 1285, 2507, 357, 357, 1108, 299, 299, 299, 182, + 2476, 182, 299, 299, 299, 285, 299, 299, 299, 299, + 201, 569, 2504, 2506, 2494, 299, 299, 300, 1698, 299, + + 2525, 978, 978, 304, 978, 2434, 978, 357, 183, 183, + 2510, 182, 182, 2495, 182, 201, 182, 2513, 249, 2478, + 1284, 1478, 1285, 2498, 357, 224, 299, 299, 182, 182, + 267, 182, 332, 182, 332, 186, 332, 332, 332, 332, + 2140, 2499, 304, 568, 2436, 332, 332, 334, 2431, 332, + 978, 978, 2500, 978, 186, 978, 182, 182, 2431, 2090, + 183, 182, 2484, 2519, 186, 2515, 2434, 567, 1511, 1495, + 224, 1285, 2432, 2520, 235, 267, 332, 332, 182, 182, + 2486, 182, 332, 182, 332, 335, 332, 332, 332, 332, + 268, 2530, 235, 2431, 186, 332, 332, 334, 2503, 332, + + 2509, 1153, 1153, 335, 1153, 2431, 1153, 2432, 2504, 183, + 201, 182, 182, 201, 2095, 566, 182, 235, 2532, 2432, + 1497, 1512, 1498, 2511, 183, 2518, 332, 332, 182, 182, + 267, 182, 182, 182, 182, 224, 182, 182, 358, 182, + 2523, 235, 357, 2522, 268, 182, 182, 183, 2434, 182, + 978, 978, 249, 978, 2527, 978, 182, 182, 2434, 182, + 2431, 182, 2435, 2578, 183, 2517, 2434, 249, 1526, 1500, + 235, 1501, 2435, 235, 2432, 334, 182, 182, 182, 182, + 2435, 182, 182, 182, 182, 2186, 182, 182, 358, 182, + 2531, 224, 2561, 2434, 186, 182, 182, 183, 2529, 182, + + 2528, 978, 978, 357, 978, 249, 978, 2435, 268, 186, + 268, 182, 182, 2534, 2090, 186, 182, 2560, 268, 2564, + 1699, 1527, 1501, 186, 224, 356, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 182, 182, 183, 370, 182, + 201, 370, 370, 370, 370, 1538, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 2533, 182, 182, 182, 182, 335, 182, 182, 182, 182, + 2535, 285, 2536, 268, 2537, 182, 182, 183, 2538, 182, + + 1346, 1346, 285, 1346, 2539, 1346, 182, 182, 2540, 2095, + 2541, 182, 285, 285, 304, 2542, 2565, 285, 1541, 1701, + 201, 1702, 304, 544, 285, 334, 182, 182, 182, 182, + 2543, 182, 182, 182, 182, 2546, 182, 182, 182, 182, + 304, 182, 182, 2504, 2506, 182, 182, 183, 304, 182, + 2545, 335, 2548, 978, 978, 2547, 978, 2549, 978, 300, + 300, 182, 182, 304, 182, 2544, 182, 335, 2550, 357, + 2554, 1542, 1553, 327, 1340, 335, 182, 182, 978, 978, + 267, 978, 978, 978, 978, 2551, 978, 978, 978, 978, + 2555, 304, 2271, 2556, 335, 978, 978, 979, 335, 978, + + 2557, 1748, 978, 978, 2552, 978, 2553, 978, 357, 335, + 2558, 182, 182, 357, 182, 357, 182, 441, 357, 357, + 2579, 1339, 235, 1340, 2559, 2566, 978, 978, 182, 182, + 267, 182, 182, 182, 182, 186, 182, 182, 182, 182, + 2563, 224, 201, 440, 2506, 182, 182, 183, 2572, 182, + 978, 978, 186, 978, 2567, 978, 182, 182, 2568, 2238, + 183, 182, 2571, 201, 2570, 224, 2576, 439, 224, 1553, + 201, 1340, 201, 2573, 1570, 267, 182, 182, 182, 182, + 2586, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 2583, 2575, 249, 235, 249, 182, 182, 183, 224, 182, + + 2581, 1338, 1338, 2580, 1338, 1571, 1338, 2584, 235, 2582, + 235, 182, 182, 2588, 182, 2589, 182, 2594, 2627, 268, + 1555, 249, 1556, 201, 249, 268, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 1587, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 438, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 1599, 235, 182, 182, 182, 182, + 2592, 182, 182, 182, 182, 2585, 182, 182, 182, 182, + 2590, 435, 268, 2591, 249, 182, 182, 183, 2596, 182, + 978, 978, 268, 978, 2595, 978, 2602, 268, 285, 2597, + 2598, 182, 182, 2624, 182, 285, 182, 2600, 285, 1559, + 186, 1348, 285, 304, 1611, 285, 182, 182, 182, 182, + 334, 182, 182, 182, 182, 2606, 182, 182, 182, 182, + 2601, 2603, 2306, 304, 304, 182, 182, 183, 1751, 182, + + 304, 978, 978, 2604, 978, 1612, 978, 2607, 2608, 2609, + 2613, 335, 2610, 2614, 357, 304, 182, 182, 335, 182, + 1347, 182, 1348, 434, 335, 335, 182, 182, 978, 978, + 357, 978, 1039, 978, 1039, 267, 1039, 1039, 1039, 1039, + 2612, 433, 2616, 2615, 2139, 1039, 1039, 1040, 335, 1039, + 978, 978, 357, 978, 357, 978, 182, 182, 2618, 2238, + 2621, 182, 2622, 2625, 2620, 224, 357, 2632, 186, 1559, + 201, 1348, 432, 186, 2633, 334, 1039, 1039, 182, 182, + 186, 182, 265, 182, 265, 224, 265, 265, 265, 265, + 186, 2623, 2635, 2683, 2626, 265, 265, 267, 224, 265, + + 1346, 1346, 201, 1346, 2629, 1346, 182, 182, 201, 182, + 2634, 182, 2694, 224, 224, 2637, 2639, 224, 2630, 1561, + 2636, 1562, 235, 235, 1639, 267, 265, 265, 182, 182, + 2629, 182, 265, 182, 265, 2376, 265, 265, 265, 265, + 235, 201, 2640, 235, 2630, 265, 265, 267, 2644, 265, + 2641, 2649, 235, 978, 978, 1640, 978, 2643, 978, 2642, + 235, 2629, 249, 2645, 249, 268, 182, 182, 249, 182, + 431, 182, 1623, 2648, 1413, 2630, 265, 265, 182, 182, + 268, 182, 182, 182, 182, 334, 182, 182, 182, 182, + 186, 2679, 430, 2654, 2185, 182, 182, 183, 249, 182, + + 285, 1811, 978, 978, 2650, 978, 2629, 978, 2655, 268, + 2656, 182, 182, 2676, 2342, 285, 182, 429, 2659, 186, + 2652, 1412, 285, 1413, 1652, 304, 182, 182, 182, 182, + 267, 182, 182, 182, 182, 2661, 182, 182, 182, 182, + 304, 2665, 428, 268, 2660, 182, 182, 183, 335, 182, + 2677, 978, 978, 2629, 978, 1653, 978, 2629, 304, 2666, + 2667, 182, 182, 186, 2343, 335, 182, 2630, 2671, 2673, + 1623, 2663, 1413, 335, 357, 357, 182, 182, 1079, 978, + 267, 978, 1079, 1079, 1079, 2689, 1079, 1079, 1079, 1079, + 285, 186, 2680, 224, 304, 1079, 1079, 1080, 2629, 1079, + + 1338, 1338, 2672, 1338, 2629, 1338, 182, 182, 2629, 2348, + 2678, 182, 2669, 2681, 186, 2695, 357, 235, 2630, 1625, + 201, 1626, 2630, 2682, 224, 267, 1079, 1079, 299, 182, + 2691, 182, 299, 299, 299, 335, 299, 299, 299, 299, + 201, 357, 2685, 2684, 186, 299, 299, 300, 2629, 299, + 978, 978, 423, 978, 2686, 978, 182, 182, 183, 182, + 201, 182, 2630, 2728, 183, 2688, 224, 201, 2687, 1628, + 2696, 1420, 224, 2690, 1681, 334, 299, 299, 299, 182, + 235, 182, 299, 299, 299, 2404, 299, 299, 299, 299, + 422, 201, 2698, 2629, 224, 299, 299, 300, 1813, 299, + + 2692, 978, 978, 2697, 978, 1682, 978, 2630, 2699, 249, + 249, 182, 182, 2724, 2342, 2726, 182, 249, 2700, 186, + 1419, 421, 1420, 186, 224, 2702, 299, 299, 978, 978, + 334, 978, 1107, 978, 1107, 249, 1107, 1107, 1107, 1107, + 2686, 2735, 268, 2703, 224, 1107, 1107, 1108, 2686, 1107, + 978, 978, 268, 978, 2687, 978, 182, 182, 2701, 2343, + 2706, 182, 2687, 2704, 235, 268, 186, 285, 2766, 1628, + 235, 1420, 2738, 2707, 2709, 334, 1107, 1107, 182, 182, + 268, 182, 332, 182, 332, 249, 332, 332, 332, 332, + 285, 285, 182, 2708, 2685, 332, 332, 334, 2686, 332, + + 1346, 1346, 285, 1346, 2686, 1346, 182, 182, 2710, 2348, + 300, 182, 2705, 2711, 2712, 304, 201, 2729, 2687, 1630, + 186, 1631, 2767, 304, 1710, 334, 332, 332, 182, 182, + 304, 182, 332, 182, 332, 268, 332, 332, 332, 332, + 2713, 285, 2716, 2715, 420, 332, 332, 334, 2718, 332, + 335, 2717, 2721, 1079, 978, 1711, 978, 304, 1079, 335, + 335, 182, 182, 2720, 182, 335, 182, 201, 2730, 357, + 357, 2686, 1664, 2723, 1459, 2770, 332, 332, 182, 182, + 267, 182, 182, 182, 182, 2714, 182, 182, 358, 182, + 357, 2722, 201, 2725, 2727, 182, 182, 183, 2782, 182, + + 357, 1846, 1079, 978, 2686, 978, 2686, 1079, 304, 186, + 186, 182, 182, 2741, 2436, 249, 182, 249, 2719, 2685, + 2687, 1458, 235, 1459, 1723, 2737, 182, 182, 182, 182, + 267, 182, 182, 182, 182, 183, 182, 182, 358, 182, + 419, 335, 235, 357, 2732, 182, 182, 183, 2734, 182, + 2739, 1079, 978, 2686, 978, 1724, 1079, 201, 2731, 224, + 183, 182, 182, 235, 182, 2765, 182, 2687, 186, 183, + 1664, 2740, 1459, 2733, 224, 418, 182, 182, 182, 182, + 334, 1572, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 1573, 182, 183, 370, 182, + + 1574, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 2686, 182, 182, 182, 182, 417, 182, 182, 182, 182, + 235, 2736, 249, 2742, 2687, 182, 182, 183, 2780, 182, + 1457, 1338, 224, 1338, 2686, 1457, 182, 182, 186, 2436, + 2768, 182, 249, 2743, 249, 2744, 186, 414, 2687, 1666, + 2779, 1667, 268, 2746, 1736, 334, 182, 182, 182, 182, + 235, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 2745, 268, 2747, 413, 268, 182, 182, 183, 2749, 182, + + 268, 2748, 285, 1079, 978, 1737, 978, 2732, 1079, 285, + 2750, 182, 182, 224, 2504, 2774, 182, 285, 2751, 285, + 2752, 2753, 1670, 183, 1467, 304, 182, 182, 1151, 1151, + 267, 1151, 1151, 1151, 1151, 412, 1151, 1151, 1151, 1151, + 304, 2754, 304, 2755, 2757, 1151, 1151, 1152, 335, 1151, + 411, 1849, 1079, 978, 182, 978, 2732, 1079, 304, 2756, + 186, 182, 182, 410, 2506, 2802, 182, 335, 2758, 335, + 2759, 1466, 300, 1467, 335, 2760, 1151, 1151, 978, 978, + 267, 978, 1153, 978, 1153, 396, 1153, 1153, 1153, 1153, + 2761, 357, 2762, 200, 357, 1153, 1153, 1154, 201, 1155, + + 1079, 978, 2769, 978, 2771, 1079, 182, 182, 392, 2504, + 2771, 182, 357, 2763, 357, 2764, 201, 2773, 2772, 1670, + 186, 1467, 2804, 224, 2772, 334, 1153, 1153, 978, 978, + 2775, 978, 978, 978, 978, 224, 978, 978, 978, 978, + 235, 201, 2776, 235, 249, 978, 978, 979, 2781, 978, + 1465, 1346, 391, 1346, 2778, 1465, 182, 182, 224, 2506, + 268, 182, 249, 2783, 2784, 2777, 268, 2787, 2785, 1672, + 285, 1673, 390, 2789, 2788, 334, 978, 1755, 182, 182, + 2771, 182, 182, 182, 182, 268, 182, 182, 182, 182, + 285, 285, 2790, 2792, 2772, 182, 182, 183, 304, 182, + + 978, 978, 2791, 978, 2771, 978, 182, 182, 2803, 2685, + 304, 182, 1756, 304, 2794, 224, 335, 249, 2786, 1694, + 2795, 1494, 2813, 2796, 186, 267, 182, 182, 182, 182, + 2771, 182, 182, 182, 182, 2800, 182, 182, 182, 182, + 335, 268, 335, 2798, 2772, 182, 182, 183, 1868, 182, + 978, 978, 357, 978, 357, 978, 182, 182, 2799, 2685, + 224, 182, 357, 2801, 2809, 385, 186, 1757, 235, 1493, + 2811, 1494, 2810, 201, 2814, 334, 182, 182, 182, 182, + 183, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 1771, 224, 182, 182, 182, 182, + 384, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 1783, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 2771, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 2831, 2812, 2815, 249, 2772, 182, 182, 183, 383, 182, + + 978, 978, 224, 978, 2771, 978, 182, 182, 2771, 2732, + 382, 182, 1797, 2818, 268, 2819, 285, 285, 2793, 1694, + 381, 1494, 2772, 183, 183, 267, 182, 182, 182, 182, + 2805, 182, 182, 182, 182, 380, 182, 182, 182, 182, + 182, 304, 2809, 379, 2806, 182, 182, 183, 2771, 182, + 1338, 1338, 378, 1338, 2771, 1338, 182, 182, 300, 2732, + 235, 182, 2797, 2822, 304, 2825, 335, 1798, 2772, 1696, + 373, 1697, 2826, 357, 372, 334, 182, 182, 978, 978, + 2805, 978, 1214, 978, 1214, 335, 1214, 1214, 1214, 1214, + 2807, 357, 2771, 2807, 2806, 1214, 1214, 1215, 2805, 1216, + + 978, 978, 2805, 978, 2808, 978, 2772, 2808, 2805, 2828, + 186, 2839, 2806, 371, 356, 247, 2806, 201, 183, 1699, + 235, 1501, 2806, 224, 2829, 183, 1214, 1214, 978, 978, + 201, 978, 1039, 978, 1039, 249, 1039, 1039, 1039, 1039, + 183, 246, 245, 2807, 186, 1039, 1039, 1040, 1870, 1039, + 978, 978, 235, 978, 2805, 978, 2807, 2808, 2807, 2832, + 224, 2805, 240, 239, 238, 183, 2842, 183, 2816, 1500, + 2817, 1501, 2808, 183, 2809, 2806, 1039, 1817, 182, 182, + 249, 182, 265, 182, 265, 206, 265, 265, 265, 265, + 183, 268, 200, 268, 186, 265, 265, 267, 285, 265, + + 978, 978, 183, 978, 2807, 978, 182, 182, 2807, 2809, + 2847, 182, 1818, 2847, 2828, 2847, 2847, 2847, 2808, 1699, + 2847, 1501, 2808, 2847, 183, 267, 265, 265, 182, 182, + 183, 182, 265, 182, 265, 2847, 265, 265, 265, 265, + 182, 285, 2828, 2805, 2829, 265, 265, 267, 2807, 265, + 1346, 1346, 2847, 1346, 2805, 1346, 2807, 2820, 300, 2805, + 183, 2805, 2821, 2847, 2847, 2847, 2847, 1819, 2823, 1701, + 2824, 1702, 2847, 2806, 2847, 2806, 265, 265, 182, 182, + 304, 182, 182, 182, 182, 304, 182, 182, 182, 182, + 224, 335, 182, 335, 2829, 182, 182, 183, 357, 182, + + 978, 978, 2847, 978, 2807, 978, 182, 182, 2840, 2809, + 300, 182, 1832, 2847, 2847, 2847, 2847, 2847, 2808, 1154, + 2847, 1155, 2841, 2847, 183, 334, 182, 182, 182, 182, + 2807, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2840, 357, 2840, 2840, 2808, 182, 182, 183, 2840, 182, + 978, 978, 2846, 978, 2841, 978, 2841, 2841, 2840, 2846, + 2847, 224, 2841, 2847, 2847, 2847, 2847, 1833, 183, 1215, + 235, 1216, 2841, 224, 2847, 183, 182, 182, 1253, 1151, + 201, 1151, 1253, 1253, 1253, 249, 1253, 1253, 1253, 1253, + 182, 2847, 2846, 2847, 186, 1253, 1253, 1254, 2840, 1253, + + 1079, 978, 2847, 978, 2840, 1079, 182, 182, 300, 2828, + 2847, 182, 2843, 2847, 2847, 2847, 2847, 2847, 2841, 1256, + 2847, 1257, 2847, 2847, 2847, 267, 1253, 1253, 1079, 978, + 2840, 978, 1255, 1079, 1255, 268, 1255, 1255, 1255, 1255, + 2847, 285, 2847, 2847, 2844, 1255, 1255, 1256, 2840, 1257, + 978, 978, 2847, 978, 2840, 978, 182, 182, 2847, 2829, + 2847, 182, 2845, 2847, 2847, 2847, 2847, 304, 2841, 1284, + 2847, 1285, 2847, 2847, 2847, 267, 1255, 1255, 1079, 978, + 2847, 978, 1079, 1079, 1079, 335, 1079, 1079, 1079, 1079, + 2847, 357, 2847, 2847, 2847, 1079, 1079, 1080, 2847, 1079, + + 978, 978, 2847, 978, 2847, 978, 182, 182, 2847, 2828, + 2847, 182, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1339, + 2847, 1340, 2847, 2847, 2847, 334, 1079, 1853, 299, 182, + 2847, 182, 299, 299, 299, 2847, 299, 299, 299, 299, + 2847, 2847, 2847, 2847, 2847, 299, 299, 300, 2847, 299, + 978, 978, 2847, 978, 2847, 978, 182, 182, 2847, 2829, + 2847, 182, 1854, 2847, 2847, 2847, 2847, 2847, 2847, 1347, + 2847, 1348, 2847, 2847, 2847, 334, 299, 299, 299, 182, + 2847, 182, 299, 299, 299, 2847, 299, 299, 299, 299, + 2847, 2847, 2847, 2847, 2847, 299, 299, 300, 2847, 299, + + 978, 978, 2847, 978, 2847, 978, 182, 182, 2847, 2846, + 2847, 182, 2847, 2847, 2847, 2847, 2847, 1855, 2847, 1412, + 2847, 1413, 2847, 2847, 2847, 267, 299, 299, 978, 978, + 2847, 978, 1283, 978, 1283, 2847, 1283, 1283, 1283, 1283, + 2847, 2847, 2847, 2847, 2847, 1283, 1283, 1284, 2847, 1285, + 978, 978, 2847, 978, 2847, 978, 182, 182, 2847, 2846, + 2847, 182, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1419, + 2847, 1420, 2847, 2847, 2847, 334, 1283, 1283, 978, 978, + 2847, 978, 1107, 978, 1107, 2847, 1107, 1107, 1107, 1107, + 2847, 2847, 2847, 2847, 2847, 1107, 1107, 1108, 2847, 1107, + + 1079, 978, 2847, 978, 2847, 1079, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1458, + 2847, 1459, 2847, 2847, 2847, 2847, 1107, 1874, 182, 182, + 2847, 182, 332, 182, 332, 2847, 332, 332, 332, 332, + 2847, 2847, 2847, 2847, 2847, 332, 332, 334, 2847, 332, + 1079, 978, 2847, 978, 2847, 1079, 2847, 2847, 2847, 2847, + 2847, 2847, 1875, 2847, 2847, 2847, 2847, 2847, 2847, 1466, + 2847, 1467, 2847, 2847, 2847, 2847, 332, 332, 182, 182, + 2847, 182, 332, 182, 332, 2847, 332, 332, 332, 332, + 2847, 2847, 2847, 2847, 2847, 332, 332, 334, 2847, 332, + + 978, 978, 2847, 978, 2847, 978, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1876, 2847, 1493, + 2847, 1494, 2847, 2847, 2847, 2847, 332, 332, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 358, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 978, 978, 2847, 978, 2847, 978, 2847, 2847, 2847, 2847, + 2847, 2847, 1889, 2847, 2847, 2847, 2847, 2847, 2847, 1500, + 2847, 1501, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 358, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1890, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 201, 182, 182, 182, 182, + 201, 201, 201, 201, 201, 182, 182, 183, 370, 182, + 1769, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 1903, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1904, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 978, 978, + 2847, 978, 1338, 978, 1338, 2847, 1338, 1338, 1338, 1338, + 2847, 2847, 2847, 2847, 2847, 1338, 1338, 1339, 2847, 1340, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1338, 1338, 1151, 1151, + 2847, 1151, 1151, 1151, 1151, 2847, 1151, 1151, 1151, 1151, + 2847, 2847, 2847, 2847, 2847, 1151, 1151, 1152, 2847, 1151, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1151, 1918, 978, 978, + 2847, 978, 1153, 978, 1153, 2847, 1153, 1153, 1153, 1153, + 2847, 2847, 2847, 2847, 2847, 1153, 1153, 1154, 2847, 1155, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1153, 1919, 978, 978, + 2847, 978, 1346, 978, 1346, 2847, 1346, 1346, 1346, 1346, + 2847, 2847, 2847, 2847, 2847, 1346, 1346, 1347, 2847, 1348, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1346, 1346, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 1923, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1924, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 224, 182, 182, 182, 182, + 225, 225, 225, 225, 225, 182, 226, 183, 224, 182, + + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 1940, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 235, 182, 182, 182, 182, + 236, 236, 236, 236, 236, 182, 226, 183, 235, 182, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 1954, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 1967, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1968, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 978, 978, + 2847, 978, 1411, 978, 1411, 2847, 1411, 1411, 1411, 1411, + 2847, 2847, 2847, 2847, 2847, 1411, 1411, 1412, 2847, 1413, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1411, 1411, 978, 978, + 2847, 978, 1214, 978, 1214, 2847, 1214, 1214, 1214, 1214, + 2847, 2847, 2847, 2847, 2847, 1214, 1214, 1215, 2847, 1216, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1214, 1981, 978, 978, + 2847, 978, 1418, 978, 1418, 2847, 1418, 1418, 1418, 1418, + 2847, 2847, 2847, 2847, 2847, 1418, 1418, 1419, 2847, 1420, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1418, 1418, 182, 182, + 2847, 182, 265, 182, 265, 2847, 265, 265, 265, 265, + 2847, 2847, 2847, 2847, 2847, 265, 265, 267, 2847, 265, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 1985, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 265, 265, 182, 182, + 2847, 182, 265, 182, 265, 2847, 265, 265, 265, 265, + 2847, 2847, 2847, 2847, 2847, 265, 265, 267, 2847, 265, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 1986, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 265, 265, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2000, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 182, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2001, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 1079, 978, + 2847, 978, 1457, 1079, 1457, 2847, 1457, 1457, 1457, 1457, + 2847, 2847, 2847, 2847, 2847, 1457, 1457, 1458, 2847, 1459, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1457, 1457, 1253, 1151, + 2847, 1151, 1253, 1253, 1253, 2847, 1253, 1253, 1253, 1253, + 2847, 2847, 2847, 2847, 2847, 1253, 1253, 1254, 2847, 1253, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1253, 2014, 1079, 978, + 2847, 978, 1255, 1079, 1255, 2847, 1255, 1255, 1255, 1255, + 2847, 2847, 2847, 2847, 2847, 1255, 1255, 1256, 2847, 1257, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1255, 2015, 1079, 978, + 2847, 978, 1465, 1079, 1465, 2847, 1465, 1465, 1465, 1465, + 2847, 2847, 2847, 2847, 2847, 1465, 1465, 1466, 2847, 1467, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1465, 1465, 299, 182, + 2847, 182, 299, 299, 299, 2847, 299, 299, 299, 299, + 2847, 2847, 2847, 2847, 2847, 299, 299, 300, 2847, 299, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2019, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 299, 299, 299, 182, + 2847, 182, 299, 299, 299, 2847, 299, 299, 299, 299, + 2847, 2847, 2847, 2847, 2847, 299, 299, 300, 2847, 299, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2020, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 299, 299, 978, 978, + 2847, 978, 1492, 978, 1492, 2847, 1492, 1492, 1492, 1492, + 2847, 2847, 2847, 2847, 2847, 1492, 1492, 1493, 2847, 1494, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1492, 1492, 978, 978, + 2847, 978, 1283, 978, 1283, 2847, 1283, 1283, 1283, 1283, + 2847, 2847, 2847, 2847, 2847, 1283, 1283, 1284, 2847, 1285, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1283, 2035, 978, 978, + 2847, 978, 1499, 978, 1499, 2847, 1499, 1499, 1499, 1499, + 2847, 2847, 2847, 2847, 2847, 1499, 1499, 1500, 2847, 1501, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1499, 1499, 182, 182, + 2847, 182, 332, 182, 332, 2847, 332, 332, 332, 332, + 2847, 2847, 2847, 2847, 2847, 332, 332, 334, 2847, 332, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2039, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 332, 332, 182, 182, + 2847, 182, 332, 182, 332, 2847, 332, 332, 332, 332, + 2847, 2847, 2847, 2847, 2847, 332, 332, 334, 2847, 332, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2040, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 332, 332, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 358, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2054, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 182, 182, + 2847, 182, 182, 182, 182, 2847, 182, 182, 358, 182, + 2847, 2847, 2847, 2847, 2847, 182, 182, 183, 2847, 182, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2055, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 182, 182, 978, 978, + 2847, 978, 1338, 978, 1338, 2847, 1338, 1338, 1338, 1338, + 2847, 2847, 2847, 2847, 2847, 1338, 1338, 1339, 2847, 1340, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1338, 2080, 978, 978, + 2847, 978, 1346, 978, 1346, 2847, 1346, 1346, 1346, 1346, + 2847, 2847, 2847, 2847, 2847, 1346, 1346, 1347, 2847, 1348, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1346, 2081, 978, 978, + 2847, 978, 1411, 978, 1411, 2847, 1411, 1411, 1411, 1411, + 2847, 2847, 2847, 2847, 2847, 1411, 1411, 1412, 2847, 1413, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1411, 2137, 978, 978, + 2847, 978, 1418, 978, 1418, 2847, 1418, 1418, 1418, 1418, + 2847, 2847, 2847, 2847, 2847, 1418, 1418, 1419, 2847, 1420, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1418, 2138, 1079, 978, + 2847, 978, 1457, 1079, 1457, 2847, 1457, 1457, 1457, 1457, + 2847, 2847, 2847, 2847, 2847, 1457, 1457, 1458, 2847, 1459, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1457, 2166, 1079, 978, + 2847, 978, 1465, 1079, 1465, 2847, 1465, 1465, 1465, 1465, + 2847, 2847, 2847, 2847, 2847, 1465, 1465, 1466, 2847, 1467, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1465, 2167, 978, 978, + 2847, 978, 1492, 978, 1492, 2847, 1492, 1492, 1492, 1492, + 2847, 2847, 2847, 2847, 2847, 1492, 1492, 1493, 2847, 1494, + + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1492, 2183, 978, 978, + 2847, 978, 1499, 978, 1499, 2847, 1499, 1499, 1499, 1499, + 2847, 2847, 2847, 2847, 2847, 1499, 1499, 1500, 2847, 1501, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 1499, 2184, 30, 30, + 30, 30, 30, 30, 30, 70, 70, 70, 70, 70, + 70, 70, 83, 83, 83, 83, 83, 83, 83, 99, + + 99, 99, 99, 99, 99, 99, 111, 111, 111, 111, + 111, 111, 111, 155, 155, 155, 155, 155, 155, 155, + 180, 180, 2847, 180, 180, 180, 180, 182, 182, 2847, + 182, 182, 182, 182, 199, 199, 2847, 199, 199, 199, + 199, 201, 201, 2847, 201, 201, 201, 201, 202, 202, + 2847, 202, 202, 202, 202, 219, 219, 2847, 219, 2847, + 219, 221, 2847, 221, 249, 249, 2847, 249, 249, 249, + 249, 262, 262, 262, 262, 263, 263, 263, 263, 265, + 265, 2847, 265, 265, 265, 265, 268, 268, 2847, 268, + 268, 268, 268, 269, 269, 2847, 269, 269, 269, 269, + + 285, 285, 2847, 285, 285, 285, 285, 296, 2847, 2847, + 296, 296, 296, 296, 297, 297, 2847, 297, 297, 297, + 297, 298, 2847, 2847, 298, 298, 298, 298, 299, 299, + 2847, 299, 299, 299, 299, 302, 302, 2847, 302, 302, + 302, 302, 304, 304, 2847, 304, 304, 304, 304, 305, + 305, 2847, 305, 305, 305, 305, 326, 326, 326, 326, + 327, 327, 327, 327, 332, 332, 2847, 332, 332, 332, + 332, 335, 335, 2847, 335, 335, 335, 335, 336, 336, + 2847, 336, 336, 336, 336, 355, 355, 356, 356, 357, + 357, 2847, 357, 357, 357, 357, 358, 358, 2847, 358, + + 358, 358, 358, 201, 201, 2847, 201, 201, 201, 201, + 180, 180, 2847, 180, 180, 180, 180, 202, 202, 2847, + 202, 202, 202, 202, 393, 393, 2847, 393, 393, 393, + 393, 199, 199, 2847, 199, 199, 199, 199, 398, 398, + 2847, 398, 398, 398, 398, 401, 401, 2847, 401, 401, + 401, 401, 219, 219, 2847, 219, 2847, 219, 221, 2847, + 221, 249, 249, 2847, 249, 249, 249, 249, 262, 262, + 262, 262, 263, 263, 263, 263, 265, 265, 2847, 265, + 265, 265, 265, 453, 453, 2847, 453, 453, 453, 453, + 268, 268, 2847, 268, 268, 268, 268, 269, 269, 2847, + + 269, 269, 269, 269, 458, 458, 2847, 458, 458, 458, + 458, 461, 461, 2847, 461, 461, 461, 461, 285, 285, + 2847, 285, 285, 285, 285, 296, 2847, 2847, 296, 296, + 296, 296, 297, 297, 2847, 297, 297, 297, 297, 298, + 2847, 2847, 298, 298, 298, 298, 299, 299, 2847, 299, + 299, 299, 299, 493, 493, 2847, 493, 493, 493, 493, + 302, 302, 2847, 302, 302, 302, 302, 304, 304, 2847, + 304, 304, 304, 304, 305, 305, 2847, 305, 305, 305, + 305, 498, 498, 2847, 498, 498, 498, 498, 501, 501, + 2847, 501, 501, 501, 501, 326, 326, 326, 326, 327, + + 327, 327, 327, 332, 332, 2847, 332, 332, 332, 332, + 524, 524, 2847, 524, 524, 524, 524, 335, 335, 2847, + 335, 335, 335, 335, 336, 336, 2847, 336, 336, 336, + 336, 529, 529, 2847, 529, 529, 529, 529, 532, 532, + 2847, 532, 532, 532, 532, 355, 355, 356, 356, 357, + 357, 2847, 357, 357, 357, 357, 358, 358, 2847, 358, + 358, 358, 358, 393, 393, 2847, 393, 393, 393, 393, + 590, 590, 2847, 590, 590, 590, 590, 199, 199, 2847, + 199, 199, 199, 199, 202, 202, 2847, 202, 202, 202, + 202, 398, 398, 2847, 398, 398, 398, 398, 401, 401, + + 2847, 401, 401, 401, 401, 596, 596, 2847, 596, 596, + 596, 596, 607, 607, 2847, 607, 607, 607, 607, 201, + 201, 2847, 201, 201, 201, 201, 249, 249, 2847, 249, + 249, 249, 249, 453, 453, 2847, 453, 453, 453, 453, + 653, 653, 2847, 653, 653, 653, 653, 265, 265, 2847, + 265, 265, 265, 265, 269, 269, 2847, 269, 269, 269, + 269, 458, 458, 2847, 458, 458, 458, 458, 461, 461, + 2847, 461, 461, 461, 461, 658, 658, 2847, 658, 658, + 658, 658, 669, 669, 2847, 669, 669, 669, 669, 268, + 268, 2847, 268, 268, 268, 268, 285, 285, 2847, 285, + + 285, 285, 285, 299, 299, 2847, 299, 299, 299, 299, + 493, 493, 2847, 493, 493, 493, 493, 693, 693, 2847, + 693, 693, 693, 693, 302, 302, 2847, 302, 302, 302, + 302, 305, 305, 2847, 305, 305, 305, 305, 498, 498, + 2847, 498, 498, 498, 498, 501, 501, 2847, 501, 501, + 501, 501, 699, 699, 2847, 699, 699, 699, 699, 710, + 710, 2847, 710, 710, 710, 710, 304, 304, 2847, 304, + 304, 304, 304, 327, 327, 327, 327, 524, 524, 2847, + 524, 524, 524, 524, 724, 724, 2847, 724, 724, 724, + 724, 332, 332, 2847, 332, 332, 332, 332, 336, 336, + + 2847, 336, 336, 336, 336, 529, 529, 2847, 529, 529, + 529, 529, 532, 532, 2847, 532, 532, 532, 532, 729, + 729, 2847, 729, 729, 729, 729, 740, 740, 2847, 740, + 740, 740, 740, 335, 335, 2847, 335, 335, 335, 335, + 357, 357, 2847, 357, 357, 357, 357, 182, 182, 2847, + 182, 182, 182, 182, 186, 186, 2847, 186, 186, 186, + 186, 393, 393, 2847, 393, 393, 393, 393, 590, 590, + 2847, 590, 590, 590, 590, 787, 787, 2847, 787, 787, + 787, 787, 788, 788, 2847, 788, 788, 788, 788, 401, + 401, 2847, 401, 401, 401, 401, 596, 596, 2847, 596, + + 596, 596, 596, 607, 607, 2847, 607, 607, 607, 607, + 201, 201, 2847, 201, 201, 201, 201, 249, 249, 2847, + 249, 249, 249, 249, 453, 453, 2847, 453, 453, 453, + 453, 653, 653, 2847, 653, 653, 653, 653, 846, 846, + 2847, 846, 846, 846, 846, 461, 461, 2847, 461, 461, + 461, 461, 658, 658, 2847, 658, 658, 658, 658, 265, + 265, 2847, 265, 265, 265, 265, 669, 669, 2847, 669, + 669, 669, 669, 268, 268, 2847, 268, 268, 268, 268, + 285, 285, 2847, 285, 285, 285, 285, 493, 493, 2847, + 493, 493, 493, 493, 693, 693, 2847, 693, 693, 693, + + 693, 882, 882, 2847, 882, 882, 882, 882, 883, 883, + 2847, 883, 883, 883, 883, 501, 501, 2847, 501, 501, + 501, 501, 699, 699, 2847, 699, 699, 699, 699, 299, + 299, 2847, 299, 299, 299, 299, 710, 710, 2847, 710, + 710, 710, 710, 304, 304, 2847, 304, 304, 304, 304, + 327, 327, 327, 327, 524, 524, 2847, 524, 524, 524, + 524, 724, 724, 2847, 724, 724, 724, 724, 908, 908, + 2847, 908, 908, 908, 908, 532, 532, 2847, 532, 532, + 532, 532, 729, 729, 2847, 729, 729, 729, 729, 332, + 332, 2847, 332, 332, 332, 332, 740, 740, 2847, 740, + + 740, 740, 740, 335, 335, 2847, 335, 335, 335, 335, + 357, 357, 2847, 357, 357, 357, 357, 182, 182, 2847, + 182, 182, 182, 182, 186, 186, 2847, 186, 186, 186, + 186, 962, 962, 2847, 962, 962, 962, 962, 787, 787, + 2847, 787, 787, 787, 787, 788, 788, 2847, 788, 788, + 788, 788, 965, 965, 2847, 965, 965, 965, 965, 978, + 978, 2847, 978, 978, 978, 978, 201, 201, 2847, 201, + 201, 201, 201, 249, 249, 2847, 249, 249, 249, 249, + 1024, 1024, 2847, 1024, 1024, 1024, 1024, 846, 846, 2847, + 846, 846, 846, 846, 1026, 1026, 2847, 1026, 1026, 1026, + + 1026, 265, 265, 2847, 265, 265, 265, 265, 1039, 1039, + 2847, 1039, 1039, 1039, 1039, 268, 268, 2847, 268, 268, + 268, 268, 285, 285, 2847, 285, 285, 285, 285, 1063, + 1063, 2847, 1063, 1063, 1063, 1063, 882, 882, 2847, 882, + 882, 882, 882, 883, 883, 2847, 883, 883, 883, 883, + 1066, 1066, 2847, 1066, 1066, 1066, 1066, 299, 299, 2847, + 299, 299, 299, 299, 1079, 1079, 2847, 1079, 1079, 1079, + 1079, 304, 304, 2847, 304, 304, 304, 304, 1092, 1092, + 2847, 1092, 1092, 1092, 1092, 908, 908, 2847, 908, 908, + 908, 908, 1094, 1094, 2847, 1094, 1094, 1094, 1094, 332, + + 332, 2847, 332, 332, 332, 332, 1107, 1107, 2847, 1107, + 1107, 1107, 1107, 335, 335, 2847, 335, 335, 335, 335, + 357, 357, 2847, 357, 357, 357, 357, 186, 186, 2847, + 186, 186, 186, 186, 962, 962, 2847, 962, 962, 962, + 962, 1151, 1151, 2847, 1151, 1151, 1151, 1151, 1153, 1153, + 2847, 1153, 1153, 1153, 1153, 965, 965, 2847, 965, 965, + 965, 965, 978, 978, 2847, 978, 978, 978, 978, 201, + 201, 2847, 201, 201, 201, 201, 249, 249, 2847, 249, + 249, 249, 249, 1024, 1024, 2847, 1024, 1024, 1024, 1024, + 1214, 1214, 2847, 1214, 1214, 1214, 1214, 1026, 1026, 2847, + + 1026, 1026, 1026, 1026, 265, 265, 2847, 265, 265, 265, + 265, 1039, 1039, 2847, 1039, 1039, 1039, 1039, 268, 268, + 2847, 268, 268, 268, 268, 285, 285, 2847, 285, 285, + 285, 285, 1063, 1063, 2847, 1063, 1063, 1063, 1063, 1253, + 1253, 2847, 1253, 1253, 1253, 1253, 1255, 1255, 2847, 1255, + 1255, 1255, 1255, 1066, 1066, 2847, 1066, 1066, 1066, 1066, + 299, 299, 2847, 299, 299, 299, 299, 1079, 1079, 2847, + 1079, 1079, 1079, 1079, 304, 304, 2847, 304, 304, 304, + 304, 1092, 1092, 2847, 1092, 1092, 1092, 1092, 1283, 1283, + 2847, 1283, 1283, 1283, 1283, 1094, 1094, 2847, 1094, 1094, + + 1094, 1094, 332, 332, 2847, 332, 332, 332, 332, 1107, + 1107, 2847, 1107, 1107, 1107, 1107, 335, 335, 2847, 335, + 335, 335, 335, 357, 357, 2847, 357, 357, 357, 357, + 186, 186, 2847, 186, 186, 186, 186, 1338, 1338, 2847, + 1338, 1338, 1338, 1338, 1151, 1151, 2847, 1151, 1151, 1151, + 1151, 1153, 1153, 2847, 1153, 1153, 1153, 1153, 1343, 1343, + 2847, 1343, 1343, 1343, 1343, 1346, 1346, 2847, 1346, 1346, + 1346, 1346, 978, 978, 2847, 978, 978, 978, 978, 201, + 201, 2847, 201, 201, 201, 201, 249, 249, 2847, 249, + 249, 249, 249, 1411, 1411, 2847, 1411, 1411, 1411, 1411, + + 1214, 1214, 2847, 1214, 1214, 1214, 1214, 1415, 1415, 2847, + 1415, 1415, 1415, 1415, 1418, 1418, 2847, 1418, 1418, 1418, + 1418, 265, 265, 2847, 265, 265, 265, 265, 1039, 1039, + 2847, 1039, 1039, 1039, 1039, 268, 268, 2847, 268, 268, + 268, 268, 285, 285, 2847, 285, 285, 285, 285, 1457, + 1457, 2847, 1457, 1457, 1457, 1457, 1253, 1253, 2847, 1253, + 1253, 1253, 1253, 1255, 1255, 2847, 1255, 1255, 1255, 1255, + 1462, 1462, 2847, 1462, 1462, 1462, 1462, 1465, 1465, 2847, + 1465, 1465, 1465, 1465, 299, 299, 2847, 299, 299, 299, + 299, 1079, 1079, 2847, 1079, 1079, 1079, 1079, 304, 304, + + 2847, 304, 304, 304, 304, 1492, 1492, 2847, 1492, 1492, + 1492, 1492, 1283, 1283, 2847, 1283, 1283, 1283, 1283, 1496, + 1496, 2847, 1496, 1496, 1496, 1496, 1499, 1499, 2847, 1499, + 1499, 1499, 1499, 332, 332, 2847, 332, 332, 332, 332, + 1107, 1107, 2847, 1107, 1107, 1107, 1107, 335, 335, 2847, + 335, 335, 335, 335, 357, 357, 2847, 357, 357, 357, + 357, 186, 186, 2847, 186, 186, 186, 186, 1338, 1338, + 2847, 1338, 1338, 1338, 1338, 1554, 1554, 2847, 1554, 1554, + 1554, 1554, 1151, 1151, 2847, 1151, 1151, 1151, 1151, 1153, + 1153, 2847, 1153, 1153, 1153, 1153, 1343, 1343, 2847, 1343, + + 1343, 1343, 1343, 1346, 1346, 2847, 1346, 1346, 1346, 1346, + 1560, 1560, 2847, 1560, 1560, 1560, 1560, 1569, 1569, 2847, + 1569, 1569, 1569, 1569, 201, 201, 2847, 201, 201, 201, + 201, 249, 249, 2847, 249, 249, 249, 249, 1411, 1411, + 2847, 1411, 1411, 1411, 1411, 1624, 1624, 2847, 1624, 1624, + 1624, 1624, 1214, 1214, 2847, 1214, 1214, 1214, 1214, 1415, + 1415, 2847, 1415, 1415, 1415, 1415, 1418, 1418, 2847, 1418, + 1418, 1418, 1418, 1629, 1629, 2847, 1629, 1629, 1629, 1629, + 265, 265, 2847, 265, 265, 265, 265, 1638, 1638, 2847, + 1638, 1638, 1638, 1638, 268, 268, 2847, 268, 268, 268, + + 268, 285, 285, 2847, 285, 285, 285, 285, 1457, 1457, + 2847, 1457, 1457, 1457, 1457, 1665, 1665, 2847, 1665, 1665, + 1665, 1665, 1253, 1253, 2847, 1253, 1253, 1253, 1253, 1255, + 1255, 2847, 1255, 1255, 1255, 1255, 1462, 1462, 2847, 1462, + 1462, 1462, 1462, 1465, 1465, 2847, 1465, 1465, 1465, 1465, + 1671, 1671, 2847, 1671, 1671, 1671, 1671, 299, 299, 2847, + 299, 299, 299, 299, 1680, 1680, 2847, 1680, 1680, 1680, + 1680, 304, 304, 2847, 304, 304, 304, 304, 1492, 1492, + 2847, 1492, 1492, 1492, 1492, 1695, 1695, 2847, 1695, 1695, + 1695, 1695, 1283, 1283, 2847, 1283, 1283, 1283, 1283, 1496, + + 1496, 2847, 1496, 1496, 1496, 1496, 1499, 1499, 2847, 1499, + 1499, 1499, 1499, 1700, 1700, 2847, 1700, 1700, 1700, 1700, + 332, 332, 2847, 332, 332, 332, 332, 1709, 1709, 2847, + 1709, 1709, 1709, 1709, 335, 335, 2847, 335, 335, 335, + 335, 357, 357, 2847, 357, 357, 357, 357, 182, 182, + 2847, 182, 182, 182, 182, 186, 186, 2847, 186, 186, + 186, 186, 1338, 1338, 2847, 1338, 1338, 1338, 1338, 1554, + 1554, 2847, 1554, 1554, 1554, 1554, 1749, 1749, 2847, 1749, + 1749, 1749, 1749, 1750, 1750, 2847, 1750, 1750, 1750, 1750, + 1346, 1346, 2847, 1346, 1346, 1346, 1346, 1560, 1560, 2847, + + 1560, 1560, 1560, 1560, 1569, 1569, 2847, 1569, 1569, 1569, + 1569, 201, 201, 2847, 201, 201, 201, 201, 249, 249, + 2847, 249, 249, 249, 249, 1411, 1411, 2847, 1411, 1411, + 1411, 1411, 1624, 1624, 2847, 1624, 1624, 1624, 1624, 1812, + 1812, 2847, 1812, 1812, 1812, 1812, 1418, 1418, 2847, 1418, + 1418, 1418, 1418, 1629, 1629, 2847, 1629, 1629, 1629, 1629, + 265, 265, 2847, 265, 265, 265, 265, 1638, 1638, 2847, + 1638, 1638, 1638, 1638, 268, 268, 2847, 268, 268, 268, + 268, 285, 285, 2847, 285, 285, 285, 285, 1457, 1457, + 2847, 1457, 1457, 1457, 1457, 1665, 1665, 2847, 1665, 1665, + + 1665, 1665, 1847, 1847, 2847, 1847, 1847, 1847, 1847, 1848, + 1848, 2847, 1848, 1848, 1848, 1848, 1465, 1465, 2847, 1465, + 1465, 1465, 1465, 1671, 1671, 2847, 1671, 1671, 1671, 1671, + 299, 299, 2847, 299, 299, 299, 299, 1680, 1680, 2847, + 1680, 1680, 1680, 1680, 304, 304, 2847, 304, 304, 304, + 304, 1492, 1492, 2847, 1492, 1492, 1492, 1492, 1695, 1695, + 2847, 1695, 1695, 1695, 1695, 1869, 1869, 2847, 1869, 1869, + 1869, 1869, 1499, 1499, 2847, 1499, 1499, 1499, 1499, 1700, + 1700, 2847, 1700, 1700, 1700, 1700, 332, 332, 2847, 332, + 332, 332, 332, 1709, 1709, 2847, 1709, 1709, 1709, 1709, + + 335, 335, 2847, 335, 335, 335, 335, 357, 357, 2847, + 357, 357, 357, 357, 186, 186, 2847, 186, 186, 186, + 186, 1917, 1917, 2847, 1917, 1917, 1917, 1917, 1749, 1749, + 2847, 1749, 1749, 1749, 1749, 1750, 1750, 2847, 1750, 1750, + 1750, 1750, 1920, 1920, 2847, 1920, 1920, 1920, 1920, 182, + 182, 2847, 182, 182, 182, 182, 978, 978, 2847, 978, + 978, 978, 978, 201, 201, 2847, 201, 201, 201, 201, + 249, 249, 2847, 249, 249, 249, 249, 1980, 1980, 2847, + 1980, 1980, 1980, 1980, 1812, 1812, 2847, 1812, 1812, 1812, + 1812, 1982, 1982, 2847, 1982, 1982, 1982, 1982, 265, 265, + + 2847, 265, 265, 265, 265, 1039, 1039, 2847, 1039, 1039, + 1039, 1039, 268, 268, 2847, 268, 268, 268, 268, 285, + 285, 2847, 285, 285, 285, 285, 2013, 2013, 2847, 2013, + 2013, 2013, 2013, 1847, 1847, 2847, 1847, 1847, 1847, 1847, + 1848, 1848, 2847, 1848, 1848, 1848, 1848, 2016, 2016, 2847, + 2016, 2016, 2016, 2016, 299, 299, 2847, 299, 299, 299, + 299, 1079, 1079, 2847, 1079, 1079, 1079, 1079, 304, 304, + 2847, 304, 304, 304, 304, 2034, 2034, 2847, 2034, 2034, + 2034, 2034, 1869, 1869, 2847, 1869, 1869, 1869, 1869, 2036, + 2036, 2847, 2036, 2036, 2036, 2036, 1107, 1107, 2847, 1107, + + 1107, 1107, 1107, 335, 335, 2847, 335, 335, 335, 335, + 357, 357, 2847, 357, 357, 357, 357, 1151, 1151, 2847, + 1151, 1151, 1151, 1151, 1153, 1153, 2847, 1153, 1153, 1153, + 1153, 1214, 1214, 2847, 1214, 1214, 1214, 1214, 1253, 1253, + 2847, 1253, 1253, 1253, 1253, 1255, 1255, 2847, 1255, 1255, + 1255, 1255, 1283, 1283, 2847, 1283, 1283, 1283, 1283, 1338, + 1338, 2847, 1338, 1338, 1338, 1338, 1346, 1346, 2847, 1346, + 1346, 1346, 1346, 1411, 1411, 2847, 1411, 1411, 1411, 1411, + 1418, 1418, 2847, 1418, 1418, 1418, 1418, 1457, 1457, 2847, + 1457, 1457, 1457, 1457, 1465, 1465, 2847, 1465, 1465, 1465, + + 1465, 1492, 1492, 2847, 1492, 1492, 1492, 1492, 1499, 1499, + 2847, 1499, 1499, 1499, 1499, 25, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847 + } ; + +static yyconst flex_int16_t yy_chk[17467] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 2932, 1, 1, + 1, 1, 15, 16, 15, 16, 33, 1, 1, 1, + 27, 1, 27, 37, 33, 40, 44, 151, 15, 16, + 41, 37, 41, 43, 73, 43, 40, 45, 46, 45, + 46, 151, 136, 44, 43, 73, 136, 2908, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 3, 3, 3, 3, 3, 3, 3, 65, 3, 3, + 3, 3, 42, 92, 74, 65, 74, 3, 3, 3, + 1931, 3, 36, 36, 92, 36, 42, 36, 77, 49, + 49, 49, 49, 49, 42, 49, 53, 53, 53, 53, + 53, 36, 53, 36, 78, 77, 78, 1931, 3, 3, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 66, 7, 7, + 7, 7, 75, 76, 2898, 76, 66, 7, 7, 7, + 79, 7, 79, 93, 76, 93, 75, 80, 80, 80, + 84, 84, 84, 95, 75, 95, 97, 98, 97, 98, + 103, 107, 103, 107, 95, 108, 2888, 108, 7, 7, + + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 96, 9, 9, + 9, 9, 94, 106, 104, 2091, 134, 9, 9, 9, + 102, 9, 85, 85, 96, 85, 94, 85, 104, 134, + 106, 102, 120, 85, 94, 105, 104, 105, 110, 2091, + 110, 85, 121, 120, 121, 125, 105, 125, 9, 9, + + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 175, 11, 11, + 11, 11, 112, 331, 112, 124, 175, 11, 11, 11, + 331, 11, 86, 86, 113, 86, 113, 86, 89, 89, + 112, 89, 124, 89, 113, 123, 126, 123, 126, 89, + 419, 86, 113, 128, 419, 128, 123, 89, 11, 11, + + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 2887, 13, 13, + 13, 13, 114, 145, 114, 145, 135, 13, 13, 13, + 150, 13, 88, 88, 117, 88, 117, 88, 90, 90, + 114, 90, 135, 90, 117, 144, 146, 150, 146, 257, + 257, 88, 117, 88, 281, 281, 144, 90, 13, 13, + + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 194, 21, 21, + 21, 21, 118, 2869, 118, 122, 194, 21, 21, 21, + 147, 21, 116, 116, 127, 116, 127, 116, 148, 122, + 118, 129, 253, 129, 147, 253, 152, 122, 152, 148, + 127, 116, 147, 116, 153, 2862, 153, 129, 21, 21, + + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 32, 32, 2855, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + + 35, 35, 2826, 35, 35, 35, 35, 231, 35, 35, + 35, 35, 130, 154, 130, 154, 231, 35, 35, 35, + 160, 35, 130, 137, 137, 149, 137, 149, 137, 164, + 130, 160, 174, 161, 137, 161, 149, 2825, 138, 138, + 174, 138, 137, 138, 185, 165, 164, 165, 35, 35, + 39, 39, 185, 39, 39, 39, 39, 138, 39, 39, + 39, 39, 166, 179, 166, 179, 162, 39, 39, 39, + 163, 39, 163, 140, 140, 39, 140, 251, 140, 251, + 162, 163, 188, 193, 141, 141, 354, 141, 162, 141, + 188, 193, 140, 354, 140, 141, 212, 330, 39, 39, + + 47, 47, 47, 141, 142, 142, 330, 142, 212, 142, + 243, 47, 47, 47, 47, 47, 54, 54, 54, 254, + 258, 254, 243, 142, 293, 293, 258, 54, 54, 54, + 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 56, 56, 2822, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 61, 61, 2819, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 71, 71, 436, 71, 71, 71, 71, 168, + 71, 71, 71, 71, 168, 168, 168, 168, 168, 71, + + 71, 71, 436, 71, 168, 187, 187, 275, 187, 275, + 187, 221, 221, 221, 221, 221, 278, 221, 278, 222, + 222, 222, 222, 222, 187, 222, 187, 287, 259, 287, + 71, 71, 72, 72, 259, 72, 72, 72, 72, 230, + 72, 72, 72, 72, 252, 256, 2818, 230, 256, 72, + 72, 72, 252, 72, 255, 198, 198, 72, 198, 290, + 198, 290, 255, 276, 202, 202, 255, 202, 632, 202, + 288, 276, 203, 203, 198, 203, 198, 203, 288, 632, + 72, 72, 83, 202, 83, 202, 83, 83, 83, 83, + 279, 203, 297, 203, 297, 83, 83, 83, 279, 83, + + 204, 204, 279, 204, 2815, 204, 260, 260, 260, 264, + 264, 264, 277, 280, 282, 277, 280, 283, 294, 204, + 282, 204, 289, 283, 294, 289, 83, 83, 87, 87, + 376, 87, 87, 87, 87, 312, 87, 87, 87, 87, + 291, 292, 376, 312, 292, 87, 87, 87, 291, 87, + 205, 205, 291, 205, 295, 205, 265, 265, 435, 265, + 295, 265, 299, 311, 299, 311, 314, 313, 314, 205, + 313, 205, 300, 435, 300, 265, 87, 87, 91, 91, + 299, 91, 91, 91, 91, 318, 91, 91, 91, 91, + 300, 318, 302, 206, 302, 91, 91, 91, 206, 91, + + 206, 206, 303, 91, 303, 206, 267, 267, 1163, 267, + 302, 267, 316, 317, 317, 316, 206, 319, 352, 320, + 303, 320, 206, 319, 352, 267, 91, 91, 100, 100, + 1163, 100, 100, 100, 100, 320, 100, 100, 100, 100, + 315, 321, 322, 321, 322, 100, 100, 100, 315, 100, + 266, 266, 315, 266, 323, 266, 323, 324, 342, 324, + 342, 420, 325, 345, 325, 343, 345, 324, 420, 266, + 323, 266, 346, 343, 346, 324, 100, 100, 101, 101, + 325, 101, 101, 101, 101, 351, 101, 101, 101, 101, + 349, 350, 350, 349, 351, 101, 101, 101, 408, 101, + + 348, 269, 269, 101, 269, 360, 269, 360, 348, 602, + 270, 270, 348, 270, 408, 270, 332, 332, 353, 332, + 269, 332, 269, 363, 353, 363, 101, 101, 111, 270, + 602, 270, 111, 111, 111, 332, 111, 111, 111, 111, + 361, 362, 366, 366, 362, 111, 111, 111, 361, 111, + 271, 271, 364, 271, 451, 271, 334, 334, 451, 334, + 364, 334, 365, 381, 364, 365, 367, 368, 384, 271, + 384, 271, 367, 368, 391, 334, 111, 111, 115, 115, + 391, 115, 115, 115, 115, 385, 115, 115, 115, 115, + 404, 386, 381, 385, 386, 115, 115, 115, 404, 115, + + 272, 272, 369, 272, 387, 272, 387, 369, 369, 369, + 369, 369, 388, 389, 390, 390, 389, 369, 412, 272, + 388, 272, 424, 412, 388, 424, 115, 115, 119, 119, + 396, 119, 119, 119, 119, 392, 119, 119, 119, 119, + 422, 392, 422, 413, 2810, 119, 119, 119, 406, 119, + 405, 301, 301, 119, 301, 405, 301, 413, 405, 396, + 305, 305, 406, 305, 406, 305, 414, 791, 306, 306, + 301, 306, 301, 306, 415, 414, 119, 119, 132, 305, + 132, 305, 132, 132, 132, 132, 415, 306, 791, 306, + 416, 132, 132, 132, 407, 132, 307, 307, 416, 307, + + 425, 307, 425, 407, 423, 2804, 308, 308, 417, 308, + 407, 308, 423, 333, 333, 307, 333, 307, 333, 428, + 428, 417, 132, 132, 133, 308, 133, 308, 133, 133, + 133, 133, 333, 440, 333, 440, 418, 133, 133, 133, + 426, 133, 418, 133, 336, 336, 437, 336, 426, 336, + 427, 429, 426, 427, 382, 433, 433, 429, 430, 382, + 437, 382, 382, 336, 430, 336, 382, 438, 133, 133, + 139, 139, 441, 139, 139, 139, 139, 382, 139, 139, + 139, 139, 434, 382, 432, 441, 438, 139, 139, 139, + 432, 139, 337, 337, 439, 337, 444, 337, 445, 446, + + 452, 444, 434, 447, 450, 1973, 439, 452, 446, 448, + 450, 337, 445, 337, 449, 447, 571, 448, 139, 139, + 143, 143, 473, 143, 143, 143, 143, 449, 143, 143, + 143, 143, 1973, 474, 571, 472, 473, 143, 143, 143, + 472, 143, 474, 338, 338, 143, 338, 475, 338, 476, + 477, 484, 513, 456, 456, 478, 456, 476, 456, 475, + 480, 478, 338, 477, 338, 484, 513, 480, 143, 143, + 157, 157, 456, 157, 157, 157, 157, 489, 157, 157, + 157, 157, 479, 489, 2638, 483, 479, 157, 157, 157, + 483, 157, 339, 339, 487, 339, 485, 339, 486, 488, + + 491, 456, 487, 464, 464, 485, 464, 491, 464, 512, + 486, 339, 488, 339, 512, 492, 2618, 492, 157, 157, + 158, 158, 464, 158, 158, 158, 158, 517, 158, 158, + 464, 158, 490, 492, 515, 514, 490, 158, 158, 158, + 517, 158, 393, 393, 514, 393, 515, 393, 468, 468, + 516, 468, 543, 468, 496, 557, 496, 543, 516, 518, + 557, 393, 492, 393, 504, 518, 504, 468, 158, 158, + 159, 159, 496, 159, 159, 159, 159, 2616, 159, 159, + 159, 159, 504, 468, 505, 520, 505, 159, 159, 159, + 504, 159, 520, 394, 394, 159, 394, 546, 394, 519, + + 580, 496, 505, 519, 544, 580, 546, 505, 465, 465, + 505, 465, 394, 465, 394, 508, 544, 508, 159, 159, + 169, 169, 545, 169, 169, 169, 169, 465, 169, 169, + 169, 169, 465, 508, 547, 465, 545, 169, 169, 169, + 548, 169, 395, 395, 549, 395, 547, 395, 548, 508, + 550, 551, 551, 553, 552, 559, 550, 549, 552, 561, + 553, 395, 600, 395, 559, 600, 563, 561, 169, 169, + 170, 170, 563, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 186, 564, 186, 186, 577, 564, 558, 572, 397, 397, + 186, 397, 577, 397, 398, 398, 186, 398, 186, 398, + 558, 572, 186, 562, 186, 186, 567, 397, 186, 397, + 565, 569, 567, 398, 560, 398, 562, 565, 186, 186, + 568, 568, 186, 186, 201, 201, 560, 201, 201, 201, + 201, 569, 201, 201, 201, 201, 397, 506, 570, 506, + 574, 201, 201, 201, 576, 201, 399, 399, 575, 399, + 575, 399, 574, 570, 586, 506, 581, 576, 400, 400, + + 586, 400, 573, 400, 625, 399, 507, 399, 507, 506, + 581, 506, 201, 201, 217, 217, 217, 400, 625, 400, + 2612, 573, 583, 585, 507, 217, 217, 217, 217, 217, + 219, 219, 219, 507, 583, 587, 585, 621, 621, 587, + 507, 219, 219, 219, 219, 219, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, + + 628, 623, 628, 2610, 401, 401, 224, 401, 582, 401, + 402, 402, 224, 402, 224, 402, 623, 582, 224, 584, + 224, 224, 599, 401, 224, 401, 588, 584, 601, 402, + 605, 402, 599, 588, 224, 224, 605, 601, 224, 224, + 226, 226, 2606, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 235, 235, 2604, 235, 235, 235, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 249, 249, 613, 249, 249, 249, 249, 603, 249, 249, + 249, 249, 613, 606, 603, 612, 622, 249, 249, 249, + 606, 249, 403, 403, 612, 403, 611, 403, 527, 527, + 610, 527, 611, 527, 614, 615, 622, 610, 616, 2073, + 617, 403, 614, 403, 615, 617, 616, 527, 249, 249, + 250, 250, 627, 250, 250, 250, 250, 618, 250, 250, + + 250, 250, 624, 604, 627, 2073, 618, 250, 250, 250, + 604, 250, 453, 453, 604, 453, 527, 453, 620, 604, + 624, 631, 626, 250, 620, 631, 633, 646, 633, 454, + 454, 453, 454, 453, 454, 2600, 629, 646, 250, 250, + 263, 626, 263, 634, 263, 263, 263, 263, 454, 629, + 454, 639, 639, 263, 263, 263, 634, 263, 455, 455, + 635, 455, 637, 455, 539, 539, 635, 539, 636, 539, + 638, 643, 636, 647, 804, 637, 804, 455, 643, 455, + 640, 647, 638, 539, 263, 263, 268, 268, 675, 268, + 268, 268, 268, 640, 268, 268, 268, 268, 675, 539, + + 644, 645, 798, 268, 268, 268, 644, 268, 457, 457, + 645, 457, 648, 457, 744, 649, 798, 2598, 744, 458, + 458, 648, 458, 649, 458, 459, 459, 457, 459, 457, + 459, 790, 816, 651, 268, 268, 273, 273, 458, 273, + 458, 273, 651, 790, 459, 816, 459, 460, 460, 650, + 460, 672, 460, 673, 650, 273, 457, 676, 672, 673, + 273, 674, 273, 273, 677, 676, 460, 273, 460, 678, + 674, 679, 680, 677, 684, 683, 679, 678, 273, 1179, + 684, 680, 683, 685, 273, 274, 274, 686, 274, 274, + 274, 274, 685, 274, 274, 274, 274, 686, 704, 1179, + + 704, 687, 274, 274, 274, 688, 274, 461, 461, 687, + 461, 689, 461, 691, 688, 690, 704, 713, 274, 689, + 690, 714, 691, 717, 713, 704, 461, 714, 461, 719, + 703, 717, 703, 274, 274, 285, 285, 719, 285, 285, + 285, 285, 2594, 285, 285, 285, 285, 702, 703, 702, + 720, 703, 285, 285, 285, 720, 285, 462, 462, 705, + 462, 705, 462, 661, 661, 702, 661, 743, 661, 813, + 715, 716, 748, 813, 743, 702, 462, 705, 462, 715, + 748, 716, 661, 285, 285, 286, 286, 1915, 286, 286, + 286, 286, 661, 286, 286, 286, 286, 708, 705, 708, + + 718, 1915, 286, 286, 286, 721, 286, 463, 463, 718, + 463, 706, 463, 706, 721, 708, 746, 745, 286, 663, + 663, 708, 663, 745, 663, 746, 463, 747, 463, 706, + 707, 2592, 707, 286, 286, 298, 706, 747, 663, 298, + 298, 298, 750, 298, 298, 298, 298, 663, 707, 709, + 750, 709, 298, 298, 298, 707, 298, 493, 493, 707, + 493, 749, 493, 796, 707, 966, 752, 709, 732, 732, + 749, 732, 751, 732, 709, 752, 493, 751, 493, 805, + 796, 966, 805, 298, 298, 304, 304, 732, 304, 304, + 304, 304, 755, 304, 304, 304, 304, 732, 811, 755, + + 757, 811, 304, 304, 304, 756, 304, 466, 466, 757, + 466, 756, 466, 467, 467, 759, 467, 762, 467, 760, + 758, 2588, 762, 759, 494, 494, 466, 494, 760, 494, + 758, 761, 467, 304, 304, 309, 976, 309, 763, 761, + 466, 467, 466, 494, 765, 494, 767, 763, 467, 495, + 495, 765, 495, 309, 495, 767, 766, 768, 309, 976, + 309, 309, 766, 769, 770, 309, 771, 768, 495, 773, + 495, 769, 772, 770, 771, 774, 309, 772, 773, 815, + 968, 815, 309, 310, 310, 774, 310, 310, 310, 310, + 777, 310, 310, 310, 310, 818, 968, 777, 779, 818, + + 310, 310, 310, 778, 310, 497, 497, 779, 497, 778, + 497, 780, 781, 784, 821, 821, 310, 792, 784, 782, + 781, 780, 498, 498, 497, 498, 497, 498, 782, 792, + 2586, 310, 310, 327, 783, 327, 785, 327, 327, 327, + 327, 498, 783, 498, 1138, 785, 327, 327, 327, 793, + 327, 499, 499, 497, 499, 794, 499, 793, 794, 803, + 1138, 500, 500, 807, 500, 803, 500, 794, 501, 501, + 499, 501, 499, 501, 837, 807, 837, 327, 327, 328, + 500, 328, 500, 328, 328, 328, 328, 501, 806, 501, + 2577, 795, 328, 328, 328, 806, 328, 502, 502, 795, + + 502, 799, 502, 797, 808, 809, 810, 817, 328, 799, + 797, 814, 808, 817, 797, 809, 502, 810, 502, 819, + 830, 830, 814, 328, 328, 335, 335, 820, 335, 335, + 335, 335, 819, 335, 335, 335, 335, 832, 822, 820, + 825, 832, 335, 335, 335, 826, 335, 503, 503, 824, + 503, 822, 503, 825, 826, 2570, 824, 829, 524, 524, + 827, 524, 829, 524, 525, 525, 503, 525, 503, 525, + 827, 975, 833, 335, 335, 340, 340, 524, 340, 524, + 340, 831, 833, 525, 831, 525, 526, 526, 975, 526, + 836, 526, 528, 528, 340, 528, 836, 528, 840, 340, + + 838, 340, 340, 838, 841, 526, 340, 526, 839, 842, + 840, 528, 841, 528, 865, 839, 861, 340, 844, 842, + 843, 844, 861, 340, 341, 341, 865, 341, 341, 341, + 341, 843, 341, 341, 341, 341, 862, 864, 862, 2568, + 528, 341, 341, 341, 864, 341, 529, 529, 866, 529, + 863, 529, 867, 863, 872, 868, 866, 341, 869, 983, + 872, 869, 867, 983, 875, 529, 868, 529, 873, 876, + 873, 875, 341, 341, 357, 357, 879, 357, 357, 357, + 357, 876, 357, 357, 357, 357, 874, 879, 1925, 874, + 877, 357, 357, 357, 878, 357, 530, 530, 877, 530, + + 880, 530, 1925, 880, 878, 898, 900, 535, 535, 900, + 535, 898, 535, 903, 899, 530, 899, 530, 885, 902, + 885, 903, 357, 357, 358, 358, 535, 358, 358, 358, + 358, 902, 358, 358, 535, 358, 885, 888, 890, 888, + 890, 358, 358, 358, 971, 358, 531, 531, 885, 531, + 886, 531, 886, 971, 901, 888, 890, 848, 848, 905, + 848, 901, 848, 888, 890, 531, 2557, 531, 886, 891, + 905, 891, 358, 358, 359, 359, 848, 359, 359, 359, + 359, 972, 359, 359, 359, 359, 928, 891, 848, 886, + 972, 359, 359, 359, 928, 359, 532, 532, 904, 532, + + 894, 532, 894, 895, 891, 895, 906, 359, 904, 906, + 923, 924, 926, 924, 934, 532, 923, 532, 894, 926, + 934, 895, 359, 359, 370, 370, 894, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 383, 925, 383, 383, 925, 892, + 2551, 892, 533, 533, 383, 533, 939, 533, 534, 534, + 383, 534, 383, 534, 939, 929, 383, 892, 383, 383, + + 930, 533, 383, 533, 892, 929, 383, 534, 892, 534, + 1000, 930, 383, 383, 1000, 940, 383, 383, 409, 409, + 927, 409, 409, 409, 409, 940, 409, 409, 409, 409, + 973, 893, 927, 893, 2438, 409, 409, 409, 931, 409, + 887, 931, 887, 589, 589, 935, 589, 935, 589, 893, + 936, 973, 942, 936, 941, 942, 536, 536, 887, 536, + 2438, 536, 589, 893, 589, 941, 409, 409, 410, 410, + 887, 410, 410, 410, 410, 536, 410, 410, 410, 410, + 536, 937, 945, 536, 945, 410, 410, 410, 937, 410, + 410, 589, 938, 590, 590, 944, 590, 954, 590, 954, + + 2545, 944, 949, 946, 938, 948, 538, 538, 947, 538, + 946, 538, 590, 949, 590, 948, 410, 410, 411, 411, + 947, 411, 411, 411, 411, 538, 411, 411, 411, 411, + 955, 956, 950, 955, 538, 411, 411, 411, 956, 411, + 2539, 538, 591, 591, 950, 591, 411, 591, 957, 953, + 958, 858, 858, 960, 858, 953, 858, 974, 958, 961, + 957, 591, 961, 591, 960, 974, 411, 411, 421, 421, + 858, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, + + 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 431, 431, + 2533, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 442, 442, + 959, 442, 442, 442, 442, 967, 442, 442, 442, 442, + 959, 982, 970, 2527, 987, 442, 442, 442, 970, 442, + 442, 592, 592, 967, 592, 977, 592, 989, 984, 982, + + 984, 987, 989, 990, 977, 985, 665, 665, 990, 665, + 592, 665, 592, 998, 998, 1007, 442, 442, 443, 443, + 985, 443, 443, 443, 443, 665, 443, 443, 443, 443, + 1007, 992, 665, 988, 993, 443, 443, 443, 992, 443, + 595, 595, 988, 595, 994, 595, 443, 993, 995, 2509, + 997, 850, 850, 994, 850, 997, 850, 999, 995, 595, + 999, 595, 889, 1004, 889, 1001, 443, 443, 469, 469, + 850, 469, 469, 469, 469, 1001, 469, 469, 469, 469, + 889, 1004, 850, 889, 2353, 469, 469, 469, 595, 469, + 596, 596, 889, 596, 1005, 596, 854, 854, 1005, 854, + + 1006, 854, 1006, 1009, 1010, 1011, 1017, 1012, 1017, 596, + 1011, 596, 1012, 1010, 1020, 854, 469, 469, 470, 470, + 1009, 470, 470, 470, 470, 1015, 470, 470, 470, 470, + 1016, 1020, 854, 1018, 1016, 470, 470, 470, 1021, 470, + 470, 597, 597, 1015, 597, 1022, 597, 1021, 1018, 1023, + 1022, 1044, 1043, 1050, 1023, 1044, 667, 667, 1050, 667, + 597, 667, 597, 1045, 2337, 1045, 470, 470, 471, 471, + 1043, 471, 471, 471, 471, 667, 471, 471, 471, 471, + 1054, 667, 1046, 1048, 1055, 471, 471, 471, 1055, 471, + 598, 598, 1057, 598, 1049, 598, 471, 1046, 1054, 2322, + + 1048, 664, 664, 1049, 664, 1051, 664, 1057, 1059, 598, + 1051, 598, 1056, 1064, 1056, 1064, 471, 471, 481, 481, + 664, 481, 481, 481, 481, 1059, 481, 481, 481, 481, + 1067, 1064, 1067, 1061, 1086, 481, 481, 481, 1061, 481, + 481, 664, 652, 652, 1060, 652, 1388, 652, 1067, 1086, + 1062, 735, 735, 1060, 735, 1062, 735, 1070, 1085, 1070, + 1085, 652, 1083, 652, 1067, 1388, 481, 481, 482, 482, + 735, 482, 482, 482, 482, 1070, 482, 482, 482, 482, + 1083, 1069, 1075, 1069, 1075, 482, 482, 482, 1088, 482, + 652, 735, 653, 653, 1084, 653, 482, 653, 1084, 1069, + + 1075, 856, 856, 1166, 856, 1088, 856, 1071, 1075, 1071, + 1166, 653, 1068, 653, 1068, 1069, 482, 482, 509, 509, + 856, 509, 509, 509, 509, 1071, 509, 509, 509, 509, + 1068, 1071, 1111, 1090, 856, 509, 509, 509, 1090, 509, + 654, 654, 1079, 654, 1079, 654, 1089, 1077, 1068, 1077, + 1111, 910, 910, 1091, 910, 1089, 910, 1350, 1091, 654, + 1079, 654, 1074, 1350, 1074, 1077, 509, 509, 510, 510, + 910, 510, 510, 510, 510, 1117, 510, 510, 510, 510, + 1074, 1072, 910, 1072, 1117, 510, 510, 510, 1077, 510, + 510, 655, 655, 1112, 655, 2310, 655, 1112, 1113, 1072, + + 1113, 1074, 1080, 1124, 1080, 1124, 668, 668, 1072, 668, + 655, 668, 655, 1073, 1171, 1073, 510, 510, 511, 511, + 1080, 511, 511, 511, 511, 668, 511, 511, 511, 511, + 1171, 1073, 668, 1114, 1122, 511, 511, 511, 1118, 511, + 1073, 1193, 1116, 1118, 537, 537, 511, 537, 1114, 537, + 657, 657, 1122, 657, 1193, 657, 1119, 658, 658, 1116, + 658, 1119, 658, 537, 1371, 1371, 511, 511, 521, 657, + 521, 657, 521, 521, 521, 521, 658, 537, 658, 537, + 1123, 521, 521, 521, 1123, 521, 659, 659, 1076, 659, + 1076, 659, 2297, 1128, 1125, 1129, 660, 660, 657, 660, + + 1129, 660, 1128, 1158, 521, 659, 1076, 659, 1078, 1125, + 1078, 1158, 521, 521, 522, 660, 522, 660, 522, 522, + 522, 522, 1127, 1076, 1132, 1130, 1078, 522, 522, 522, + 1130, 522, 1134, 662, 662, 1078, 662, 522, 662, 1127, + 1133, 1136, 1132, 1143, 1133, 1143, 1168, 1134, 734, 734, + 1136, 734, 662, 734, 1141, 662, 2287, 1137, 522, 522, + 540, 540, 1137, 540, 540, 540, 540, 734, 540, 540, + 540, 540, 1141, 1144, 1146, 1168, 734, 540, 540, 540, + 1142, 540, 692, 692, 1142, 692, 1147, 692, 1144, 1160, + 2275, 1146, 1148, 912, 912, 1147, 912, 1148, 912, 1149, + + 1173, 692, 1157, 692, 1149, 1157, 1160, 1173, 540, 540, + 541, 541, 912, 541, 541, 541, 541, 1159, 541, 541, + 541, 541, 1165, 1176, 912, 1159, 1164, 541, 541, 541, + 692, 541, 541, 693, 693, 1164, 693, 1177, 693, 1176, + 1183, 1177, 1185, 1165, 1183, 1184, 1195, 1184, 736, 736, + 1195, 736, 693, 736, 693, 1182, 2265, 1185, 541, 541, + 542, 542, 1172, 542, 542, 542, 542, 736, 542, 542, + 542, 542, 1187, 1182, 736, 1188, 1172, 542, 542, 542, + 1363, 542, 694, 694, 1188, 694, 1189, 694, 542, 1187, + 1174, 1189, 1190, 918, 918, 1363, 918, 1190, 918, 1199, + + 1201, 694, 1172, 694, 1174, 2261, 1199, 1204, 542, 542, + 555, 555, 918, 555, 555, 555, 555, 1201, 555, 555, + 555, 555, 1192, 1204, 1198, 1192, 918, 555, 555, 555, + 1174, 555, 555, 695, 695, 1206, 695, 1198, 695, 1209, + 1210, 1238, 1206, 1194, 1210, 1238, 1249, 1566, 738, 738, + 1249, 738, 695, 738, 695, 1209, 1566, 1194, 555, 555, + 556, 556, 1178, 556, 556, 556, 556, 738, 556, 556, + 556, 556, 1212, 738, 1232, 1240, 1178, 556, 556, 556, + 1194, 556, 699, 699, 1234, 699, 1251, 699, 556, 1237, + 1232, 1234, 1212, 920, 920, 1240, 920, 1245, 920, 2252, + + 1275, 699, 1178, 699, 1245, 1237, 1251, 1275, 556, 556, + 566, 566, 920, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, + 578, 578, 1196, 578, 578, 578, 578, 1243, 578, 578, + 578, 578, 1281, 1303, 2228, 1248, 1196, 578, 578, 578, + 1303, 578, 578, 1243, 698, 698, 1200, 698, 1175, 698, + 1175, 1248, 1281, 849, 849, 1175, 849, 1314, 849, 1196, + + 1200, 1273, 1175, 698, 1314, 698, 1175, 1175, 578, 578, + 579, 579, 849, 579, 579, 579, 579, 1273, 579, 579, + 579, 579, 1253, 1200, 1253, 1278, 1279, 579, 579, 579, + 1279, 579, 698, 849, 700, 700, 1205, 700, 579, 700, + 1253, 1278, 1326, 1028, 1028, 1326, 1028, 2215, 1028, 1254, + 1205, 1254, 1307, 700, 1309, 700, 1307, 1301, 579, 579, + 593, 593, 1028, 593, 593, 593, 593, 1254, 593, 593, + 593, 593, 1207, 1301, 1309, 1320, 1205, 593, 593, 593, + 1028, 593, 701, 701, 1306, 701, 1207, 701, 916, 916, + 1211, 916, 1318, 916, 1341, 1320, 1318, 1324, 1331, 2120, + + 1306, 701, 1335, 701, 1211, 1331, 1335, 916, 593, 593, + 594, 594, 1207, 594, 594, 594, 594, 1324, 594, 594, + 594, 594, 1233, 1341, 916, 1337, 1312, 594, 594, 594, + 1211, 594, 723, 723, 1235, 723, 1233, 723, 1027, 1027, + 1317, 1027, 1312, 1027, 1356, 1337, 1366, 1368, 1235, 1368, + 1366, 723, 1356, 723, 2083, 1370, 1317, 1027, 594, 594, + 607, 607, 1233, 607, 607, 607, 607, 1370, 607, 607, + 607, 607, 1239, 1027, 1235, 1355, 1329, 607, 607, 607, + 723, 607, 724, 724, 1244, 724, 1239, 724, 1029, 1029, + 1246, 1029, 1329, 1029, 1375, 1375, 1380, 1355, 1244, 1349, + + 1380, 724, 1369, 724, 1246, 1349, 1349, 1029, 607, 607, + 608, 608, 1239, 608, 608, 608, 608, 1369, 608, 608, + 608, 608, 1250, 1029, 1244, 2106, 1322, 608, 608, 608, + 1246, 608, 725, 725, 1402, 725, 1250, 725, 1030, 1030, + 1322, 1030, 1378, 1030, 1377, 608, 2106, 1377, 1390, 1402, + 1322, 725, 1390, 725, 1259, 1378, 1259, 1030, 608, 608, + 609, 609, 1250, 609, 609, 609, 609, 1383, 609, 609, + 609, 609, 1259, 1334, 1260, 1259, 1260, 609, 609, 609, + 1383, 609, 726, 726, 1391, 726, 1392, 726, 1197, 1334, + 1197, 609, 1260, 1039, 1039, 1197, 1039, 1405, 1039, 1405, + + 1260, 726, 1197, 726, 1197, 1392, 1197, 1391, 609, 609, + 619, 619, 1039, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 630, 630, 2075, 630, 630, 630, 630, 630, 630, 630, + 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, + 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, + 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, + + 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, + 641, 641, 1564, 641, 641, 641, 641, 1564, 641, 641, + 641, 641, 1261, 1384, 1261, 1918, 1352, 641, 641, 641, + 1384, 641, 728, 728, 1263, 728, 1263, 728, 1036, 1036, + 1261, 1036, 1352, 1036, 1264, 641, 1264, 1438, 1261, 1438, + 1386, 728, 1263, 728, 1262, 1396, 1262, 1036, 641, 641, + 642, 642, 1264, 642, 642, 642, 642, 1386, 642, 642, + 642, 642, 1262, 1396, 1036, 1902, 1362, 642, 642, 642, + 728, 642, 729, 729, 1365, 729, 1760, 729, 1208, 1262, + 1208, 642, 1362, 1040, 1040, 1208, 1040, 1395, 1040, 1760, + + 1365, 729, 1208, 729, 1395, 1393, 1208, 1208, 642, 642, + 656, 656, 1040, 656, 656, 656, 656, 1397, 656, 656, + 656, 656, 1393, 2131, 1269, 1398, 1269, 656, 656, 656, + 1394, 656, 730, 730, 1394, 730, 1397, 730, 1265, 1266, + 1265, 1266, 1269, 731, 731, 1398, 731, 2131, 731, 733, + 733, 730, 733, 730, 733, 1406, 1265, 1266, 656, 656, + 666, 666, 731, 666, 731, 666, 1266, 1434, 733, 1274, + 1406, 733, 739, 739, 1236, 739, 1236, 739, 1265, 666, + 1888, 1236, 1434, 1274, 851, 851, 666, 851, 1236, 851, + 666, 739, 1236, 1236, 1361, 666, 669, 669, 739, 669, + + 669, 669, 669, 851, 669, 669, 669, 669, 1361, 1274, + 1361, 851, 1374, 669, 669, 669, 1364, 669, 1268, 1276, + 1268, 853, 853, 1267, 853, 1267, 853, 1403, 1374, 1867, + 1364, 1403, 1364, 1276, 857, 857, 1268, 857, 1436, 857, + 853, 1267, 1436, 1268, 669, 669, 670, 670, 853, 670, + 670, 670, 670, 857, 670, 670, 670, 670, 1407, 1276, + 1439, 857, 1267, 670, 670, 670, 1947, 670, 911, 911, + 1407, 911, 1280, 911, 1379, 1439, 1302, 1947, 1304, 1034, + 1034, 670, 1034, 1451, 1034, 1451, 1280, 911, 1379, 1308, + 1302, 1270, 1304, 1270, 670, 670, 671, 671, 1034, 671, + + 671, 671, 671, 1308, 671, 671, 671, 671, 911, 1270, + 1448, 1379, 1280, 671, 671, 671, 1302, 671, 1304, 1034, + 1573, 913, 913, 1845, 913, 1448, 913, 671, 1313, 1308, + 1408, 1408, 1410, 1410, 915, 915, 1573, 915, 1270, 915, + 913, 1485, 1313, 1485, 671, 671, 681, 681, 913, 681, + 681, 681, 681, 915, 681, 681, 681, 681, 1440, 1323, + 1452, 915, 1595, 681, 681, 681, 1373, 681, 1313, 1595, + 1440, 919, 919, 1323, 919, 1452, 919, 1441, 1441, 1381, + 1373, 681, 1373, 1323, 1031, 1031, 1519, 1031, 1519, 1031, + 919, 1444, 1444, 1381, 681, 681, 682, 682, 919, 682, + + 682, 682, 682, 1031, 682, 682, 682, 682, 1449, 1031, + 1591, 1325, 1449, 682, 682, 682, 1381, 682, 964, 964, + 1831, 964, 1315, 964, 1247, 1325, 1247, 682, 1453, 1096, + 1096, 1247, 1096, 1591, 1096, 1325, 1315, 964, 1247, 964, + 1453, 1487, 1247, 1247, 682, 682, 696, 696, 1096, 696, + 696, 696, 696, 1487, 696, 696, 696, 696, 1319, 1454, + 1454, 1481, 1315, 696, 696, 696, 1096, 696, 1025, 1025, + 1330, 1025, 1319, 1025, 1037, 1037, 1481, 1037, 1332, 1037, + 1456, 1456, 1483, 1532, 1330, 1532, 1483, 1025, 1486, 1025, + 1488, 1488, 1332, 1037, 696, 696, 697, 697, 1319, 697, + + 697, 697, 697, 1486, 697, 697, 697, 697, 1517, 1470, + 1330, 1470, 1517, 697, 697, 697, 1037, 697, 1332, 1336, + 1032, 1032, 1277, 1032, 1277, 1032, 1521, 1470, 1515, 1277, + 1491, 1491, 1547, 1336, 1547, 1472, 1277, 1472, 1521, 1032, + 1277, 1277, 1575, 1515, 697, 697, 710, 710, 1032, 710, + 710, 710, 710, 1472, 710, 710, 710, 710, 1575, 1336, + 1468, 1520, 1468, 710, 710, 710, 1385, 710, 1360, 1389, + 1033, 1033, 1305, 1033, 1305, 1033, 1520, 1530, 1468, 1305, + 1385, 1530, 1360, 1389, 1468, 1468, 1305, 1360, 1389, 1033, + 1305, 1305, 1360, 1529, 710, 710, 711, 711, 1033, 711, + + 711, 711, 711, 1385, 711, 711, 711, 711, 1529, 1316, + 1533, 1316, 1389, 711, 711, 711, 1316, 711, 1469, 1401, + 1469, 1035, 1035, 1316, 1035, 1533, 1035, 1316, 1316, 1522, + 1522, 711, 1787, 1401, 1038, 1038, 1469, 1038, 1401, 1038, + 1035, 1787, 1469, 1401, 711, 711, 712, 712, 1035, 712, + 712, 712, 712, 1038, 712, 712, 712, 712, 1460, 1544, + 1460, 1432, 1038, 712, 712, 712, 1540, 712, 852, 852, + 1534, 852, 1540, 852, 1544, 1432, 1460, 712, 855, 855, + 1432, 855, 1534, 855, 1576, 1432, 1576, 852, 917, 917, + 852, 917, 1810, 917, 712, 712, 722, 855, 722, 852, + + 722, 722, 722, 722, 855, 1460, 1577, 917, 855, 722, + 722, 722, 1548, 722, 917, 1525, 1525, 1549, 917, 722, + 1095, 1095, 1577, 1095, 1763, 1095, 1473, 1548, 1473, 1549, + 1098, 1098, 1579, 1098, 1579, 1098, 1475, 1763, 1475, 1095, + 722, 722, 727, 727, 1473, 727, 727, 727, 727, 1098, + 727, 727, 727, 727, 1475, 1095, 1535, 1535, 1447, 727, + 727, 727, 1475, 727, 1600, 914, 914, 1609, 914, 1600, + 914, 1480, 1447, 1480, 1537, 1537, 1471, 1447, 1471, 1609, + 1065, 1065, 1447, 1065, 914, 1065, 1474, 914, 1474, 1480, + 727, 727, 737, 737, 1471, 737, 914, 737, 1572, 1065, + + 1563, 1065, 1093, 1093, 1474, 1093, 1333, 1093, 1333, 1770, + 1471, 737, 1572, 1333, 1572, 1545, 1479, 1563, 737, 1545, + 1333, 1093, 737, 1093, 1333, 1333, 1474, 737, 740, 740, + 1479, 740, 740, 740, 740, 1479, 740, 740, 740, 740, + 1479, 1584, 1482, 1755, 1482, 740, 740, 740, 1513, 740, + 1097, 1097, 1490, 1097, 1490, 1097, 1104, 1104, 1584, 1104, + 1482, 1104, 1513, 1550, 1550, 1552, 1552, 1513, 1610, 1097, + 1490, 1588, 1513, 1578, 1578, 1104, 740, 740, 741, 741, + 1610, 741, 741, 741, 741, 1097, 741, 741, 741, 741, + 1588, 1586, 1104, 1753, 1574, 741, 741, 741, 1580, 741, + + 1099, 1099, 1580, 1099, 1585, 1099, 1574, 1574, 1586, 1581, + 1574, 1102, 1102, 741, 1102, 1582, 1102, 1581, 1590, 1099, + 1585, 1582, 1590, 1592, 1593, 1099, 741, 741, 742, 742, + 1102, 742, 742, 742, 742, 1583, 742, 742, 742, 742, + 1594, 1593, 1592, 1583, 1594, 742, 742, 742, 1589, 742, + 1528, 1102, 1100, 1100, 1382, 1100, 1382, 1100, 1602, 742, + 1606, 1382, 1589, 1606, 1528, 1602, 1597, 1589, 1382, 1528, + 1382, 1100, 1382, 1568, 1528, 1596, 742, 742, 753, 753, + 1100, 753, 753, 753, 753, 1597, 753, 753, 753, 753, + 1539, 1589, 1543, 1596, 1603, 753, 753, 753, 1598, 753, + + 1603, 1604, 1101, 1101, 1539, 1101, 1543, 1101, 1604, 1539, + 1754, 1543, 1601, 753, 1539, 1614, 1543, 1614, 1598, 1605, + 1605, 1101, 1754, 1601, 1601, 1601, 753, 753, 754, 754, + 1101, 754, 754, 754, 754, 1567, 754, 754, 754, 754, + 1607, 1607, 1615, 1615, 1618, 754, 754, 754, 1608, 754, + 1613, 1608, 1618, 1103, 1103, 1616, 1103, 1616, 1103, 754, + 1617, 1619, 1613, 1613, 1617, 1620, 1613, 1619, 1643, 1645, + 1643, 1645, 1103, 1620, 1644, 1644, 754, 754, 764, 764, + 1103, 764, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 775, 775, + 1766, 775, 775, 775, 775, 1621, 775, 775, 775, 775, + 1646, 1622, 1648, 1766, 1646, 775, 775, 775, 1648, 775, + 1105, 1105, 1621, 1105, 1642, 1105, 1107, 1107, 1622, 1107, + 1647, 1107, 1565, 775, 1649, 1660, 1642, 1642, 1647, 1105, + 1642, 1660, 1649, 1650, 1651, 1107, 775, 775, 776, 776, + 1768, 776, 776, 776, 776, 1768, 776, 776, 776, 776, + 1650, 1651, 1105, 1656, 1656, 776, 776, 776, 1654, 776, + + 1551, 1662, 1106, 1106, 1655, 1106, 1655, 1106, 1658, 776, + 1654, 1654, 1658, 1657, 1654, 1657, 1659, 1661, 1662, 1752, + 1685, 1106, 1685, 1663, 1659, 1661, 776, 776, 786, 786, + 1106, 786, 786, 786, 786, 1752, 786, 786, 786, 786, + 1663, 1687, 1675, 1687, 1675, 786, 786, 786, 1960, 786, + 1108, 1108, 1676, 1108, 1676, 1108, 1221, 1221, 1769, 1221, + 1675, 1221, 1678, 1689, 1678, 1675, 1686, 1686, 1960, 1108, + 1676, 1689, 1679, 1769, 1679, 1221, 786, 786, 787, 787, + 1678, 787, 787, 787, 787, 1690, 787, 787, 787, 787, + 1679, 1690, 1221, 1692, 1688, 787, 787, 787, 1688, 787, + + 1150, 1150, 1683, 1150, 1683, 1150, 1222, 1222, 1691, 1222, + 1692, 1222, 1714, 1693, 1714, 1718, 1691, 1715, 1715, 1150, + 1683, 1150, 1716, 1718, 1716, 1222, 787, 787, 788, 788, + 1693, 788, 788, 788, 788, 1719, 788, 788, 788, 788, + 1677, 1719, 1677, 1721, 1717, 788, 788, 788, 1717, 788, + 1153, 1153, 1684, 1153, 1720, 1153, 1223, 1223, 1677, 1223, + 1721, 1223, 1720, 1722, 1684, 1684, 1729, 1677, 1684, 1153, + 1729, 1153, 1674, 1546, 1674, 1223, 788, 788, 789, 789, + 1722, 789, 789, 789, 789, 1733, 789, 789, 789, 789, + 1674, 1726, 1728, 1726, 1728, 789, 789, 789, 1730, 789, + + 1154, 1154, 1733, 1154, 1731, 1154, 1730, 1674, 1727, 1727, + 1731, 1224, 1224, 1742, 1224, 1732, 1224, 1742, 1734, 1154, + 1739, 1154, 1739, 1732, 1740, 1740, 789, 789, 801, 801, + 1224, 801, 801, 801, 801, 1734, 801, 801, 801, 801, + 1741, 1746, 1741, 1777, 1777, 801, 801, 801, 1759, 801, + 1155, 1155, 1224, 1155, 1713, 1155, 1228, 1228, 1746, 1228, + 1743, 1228, 1759, 1759, 801, 1745, 1713, 1713, 1743, 1155, + 1713, 1155, 1536, 1745, 1744, 1228, 801, 801, 802, 802, + 1744, 802, 802, 802, 802, 1747, 802, 802, 802, 802, + 1758, 1761, 1764, 1761, 1765, 802, 802, 802, 1765, 802, + + 1156, 1156, 1747, 1156, 1531, 1156, 1758, 802, 1772, 1764, + 1774, 1291, 1291, 1772, 1291, 1776, 1291, 1774, 1775, 1156, + 1778, 1156, 1776, 1778, 1775, 1523, 802, 802, 812, 812, + 1291, 812, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, 823, 823, + 1518, 823, 823, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 823, 823, 823, 823, 823, 823, 823, + + 823, 823, 823, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 823, 823, 823, 823, 823, 834, 834, + 1773, 834, 834, 834, 834, 1921, 834, 834, 834, 834, + 1781, 1773, 1773, 1773, 1921, 834, 834, 834, 1762, 834, + 1213, 1213, 1781, 1213, 1725, 1213, 1229, 1229, 1784, 1229, + 1780, 1229, 1762, 1780, 834, 1784, 1725, 1725, 1786, 1213, + 1725, 1213, 1779, 1779, 1786, 1229, 834, 834, 835, 835, + 1767, 835, 835, 835, 835, 1762, 835, 835, 835, 835, + 1782, 1785, 1904, 1904, 1767, 835, 835, 835, 1785, 835, + + 1214, 1214, 1782, 1214, 1229, 1214, 1785, 835, 1790, 1789, + 1788, 1292, 1292, 1794, 1292, 1789, 1292, 1767, 1790, 1214, + 1791, 1214, 2514, 1791, 1788, 1794, 835, 835, 845, 845, + 1292, 845, 845, 845, 845, 1792, 845, 845, 845, 845, + 1788, 1792, 2514, 1808, 1793, 845, 845, 845, 1808, 845, + 1215, 1215, 1738, 1215, 1795, 1215, 1290, 1290, 1793, 1290, + 1796, 1290, 1795, 1489, 1738, 1738, 1805, 1796, 1738, 1215, + 1805, 1215, 1800, 1804, 1793, 1290, 845, 845, 846, 846, + 1802, 846, 846, 846, 846, 1800, 846, 846, 846, 846, + 1804, 2147, 1290, 1799, 1802, 846, 846, 846, 1809, 846, + + 1216, 1216, 1801, 1216, 1801, 1216, 1807, 1799, 1799, 1803, + 1806, 1293, 1293, 1809, 1293, 2147, 1293, 1802, 1825, 1216, + 1807, 1216, 1803, 1806, 1916, 1916, 846, 846, 847, 847, + 1293, 847, 847, 847, 847, 1825, 847, 847, 847, 847, + 1822, 1821, 1822, 1807, 1484, 847, 847, 847, 1820, 847, + 1217, 1217, 1293, 1217, 1821, 1217, 1297, 1297, 1910, 1297, + 1824, 1297, 1820, 1820, 1826, 1829, 1926, 1926, 1826, 1217, + 1829, 1217, 1827, 1824, 1910, 1297, 847, 847, 859, 859, + 1823, 859, 859, 859, 859, 1827, 859, 859, 859, 859, + 1836, 1835, 1836, 1830, 1823, 859, 859, 859, 1828, 859, + + 1218, 1218, 1838, 1218, 1835, 1218, 1423, 1423, 1830, 1423, + 1841, 1423, 1828, 1839, 859, 1838, 1840, 1823, 1907, 1218, + 1840, 1907, 1218, 1841, 1861, 1423, 859, 859, 860, 860, + 1839, 860, 860, 860, 860, 1828, 860, 860, 860, 860, + 1858, 1861, 1858, 1455, 1844, 860, 860, 860, 1834, 860, + 1843, 1857, 1860, 1219, 1219, 1843, 1219, 860, 1219, 1844, + 1863, 1837, 1834, 1834, 1857, 1860, 1220, 1220, 2218, 1220, + 1862, 1220, 1219, 1863, 1862, 1837, 860, 860, 870, 870, + 1219, 870, 870, 870, 870, 1220, 870, 870, 870, 870, + 1850, 2218, 1850, 1220, 1866, 870, 870, 870, 1837, 870, + + 1878, 1856, 1225, 1225, 1842, 1225, 1859, 1225, 1850, 1866, + 1879, 1864, 1879, 1878, 870, 1856, 1856, 1851, 1842, 1851, + 1859, 1225, 1928, 1928, 1850, 1864, 870, 870, 871, 871, + 1225, 871, 871, 871, 871, 1851, 871, 871, 871, 871, + 1852, 1842, 1852, 1859, 1450, 871, 871, 871, 1864, 871, + 1226, 1226, 1930, 1226, 1853, 1226, 1853, 871, 1852, 1877, + 1865, 1295, 1295, 1883, 1295, 1865, 1295, 1883, 1930, 1226, + 1852, 1880, 1853, 1877, 1877, 1882, 871, 871, 881, 881, + 1295, 881, 881, 881, 881, 1880, 881, 881, 881, 881, + 1226, 1911, 1882, 1881, 1911, 881, 881, 881, 1884, 881, + + 1892, 1295, 1442, 1887, 1227, 1227, 1881, 1227, 1880, 1227, + 1886, 1884, 1893, 1892, 1893, 1886, 1288, 1288, 1887, 1288, + 1900, 1288, 1437, 1227, 1896, 1900, 881, 881, 882, 882, + 1227, 882, 882, 882, 882, 1288, 882, 882, 882, 882, + 1897, 1896, 1409, 1288, 1897, 882, 882, 882, 1885, 882, + 1252, 1252, 1891, 1252, 1894, 1252, 1298, 1298, 1903, 1298, + 1895, 1298, 1885, 1923, 1903, 1924, 1891, 1891, 1894, 1252, + 1404, 1252, 1923, 1895, 1924, 1298, 882, 882, 883, 883, + 1898, 883, 883, 883, 883, 1885, 883, 883, 883, 883, + 1927, 1894, 2160, 1898, 1927, 883, 883, 883, 1899, 883, + + 1255, 1255, 1901, 1255, 1298, 1255, 1424, 1424, 1906, 1424, + 1909, 1424, 1899, 1922, 1933, 1933, 2160, 1901, 1914, 1255, + 1906, 1255, 1909, 1922, 1914, 1424, 883, 883, 884, 884, + 1908, 884, 884, 884, 884, 1899, 884, 884, 884, 884, + 1965, 1424, 1912, 1965, 1908, 884, 884, 884, 1929, 884, + 1256, 1256, 1905, 1256, 1912, 1256, 1425, 1425, 1913, 1425, + 1938, 1425, 1929, 2071, 1929, 1905, 1908, 1905, 2071, 1256, + 1938, 1256, 1913, 1934, 1934, 1425, 884, 884, 896, 896, + 1978, 896, 896, 896, 896, 1939, 896, 896, 896, 896, + 1978, 1939, 1936, 1932, 1913, 896, 896, 896, 1937, 896, + + 1257, 1257, 1932, 1257, 1935, 1257, 1426, 1426, 1936, 1426, + 1372, 1426, 1937, 1951, 896, 1940, 1940, 1941, 1935, 1257, + 1935, 1257, 1944, 1941, 1951, 1426, 896, 896, 897, 897, + 1944, 897, 897, 897, 897, 1937, 897, 897, 897, 897, + 2100, 1943, 1945, 2100, 1942, 897, 897, 897, 1943, 897, + 1258, 1258, 1942, 1258, 1952, 1258, 1945, 897, 1946, 1942, + 1949, 1427, 1427, 1952, 1427, 1946, 1427, 1949, 1948, 1258, + 1948, 1258, 1954, 1945, 1954, 1367, 897, 897, 907, 907, + 1427, 907, 907, 907, 907, 1953, 907, 907, 907, 907, + 1955, 1953, 1955, 1970, 1970, 907, 907, 907, 1354, 907, + + 1282, 1282, 1427, 1282, 1950, 1282, 1433, 1433, 1956, 1433, + 1962, 1433, 1957, 1958, 1959, 1956, 1962, 1966, 1950, 1282, + 1957, 1282, 1959, 2086, 1958, 1433, 907, 907, 908, 908, + 1966, 908, 908, 908, 908, 1950, 908, 908, 908, 908, + 1961, 2086, 1961, 1992, 1963, 908, 908, 908, 1969, 908, + 1283, 1283, 1963, 1283, 1967, 1283, 1435, 1435, 1968, 1435, + 1964, 1435, 1969, 1967, 1971, 1972, 1972, 1968, 1971, 1283, + 1992, 1283, 1975, 1975, 1964, 1435, 908, 908, 909, 909, + 1353, 909, 909, 909, 909, 1974, 909, 909, 909, 909, + 1964, 1976, 1976, 2006, 1974, 909, 909, 909, 1977, 909, + + 1284, 1284, 1979, 1284, 1985, 1284, 1443, 1443, 1979, 1443, + 1987, 1443, 1977, 1985, 1986, 1988, 1988, 2500, 1989, 1284, + 2006, 1284, 1989, 1986, 1987, 1443, 909, 909, 921, 921, + 1997, 921, 921, 921, 921, 1977, 921, 921, 921, 921, + 1990, 1990, 2500, 1993, 1997, 921, 921, 921, 1998, 921, + 1285, 1285, 1993, 1285, 1999, 1285, 1504, 1504, 1998, 1504, + 1999, 1504, 1994, 1994, 921, 1995, 1995, 1997, 2082, 1285, + 2004, 1285, 2003, 2003, 2004, 1504, 921, 921, 922, 922, + 2082, 922, 922, 922, 922, 2000, 922, 922, 922, 922, + 2002, 2005, 2005, 2001, 2000, 922, 922, 922, 2026, 922, + + 1286, 1286, 2001, 1286, 2002, 1286, 2007, 922, 2008, 2008, + 2011, 1506, 1506, 2032, 1506, 2007, 1506, 2009, 2009, 1286, + 2011, 1286, 2014, 2032, 2014, 2026, 922, 922, 932, 932, + 1506, 932, 932, 932, 932, 2012, 932, 932, 932, 932, + 2014, 2012, 2018, 2019, 2018, 932, 932, 932, 2010, 932, + 1287, 1287, 2019, 1287, 2020, 1287, 1505, 1505, 1351, 1505, + 2018, 1505, 2010, 2020, 932, 2033, 2021, 2022, 2022, 1287, + 2018, 2033, 1287, 2024, 2024, 1505, 932, 932, 933, 933, + 2021, 933, 933, 933, 933, 2010, 933, 933, 933, 933, + 2101, 1505, 2017, 2101, 2017, 933, 933, 933, 2023, 933, + + 2027, 2043, 2023, 1289, 1289, 2043, 1289, 933, 1289, 2027, + 2017, 2028, 2028, 2029, 2029, 2039, 2040, 2042, 2042, 2017, + 2044, 2044, 1289, 1186, 2039, 2040, 933, 933, 943, 943, + 1289, 943, 943, 943, 943, 943, 943, 943, 943, 943, + 943, 943, 943, 943, 943, 943, 943, 943, 943, 943, + 943, 943, 943, 943, 943, 943, 943, 943, 943, 943, + 943, 943, 943, 943, 943, 943, 943, 943, 943, 943, + 943, 943, 943, 943, 943, 943, 943, 943, 951, 951, + 2031, 951, 951, 951, 951, 1181, 951, 951, 951, 951, + 2025, 2030, 2025, 2030, 2031, 951, 951, 951, 2041, 951, + + 2058, 2047, 1294, 1294, 2058, 1294, 2051, 1294, 2025, 2030, + 2047, 2069, 2041, 2046, 951, 2048, 2048, 2031, 2049, 2049, + 2051, 1294, 2057, 2057, 2069, 2052, 951, 951, 952, 952, + 1294, 952, 952, 952, 952, 2052, 952, 952, 952, 952, + 2046, 2054, 2053, 2051, 2055, 952, 952, 952, 2053, 952, + 2054, 1338, 1338, 2055, 1338, 2061, 1338, 952, 2065, 2056, + 2059, 2059, 2107, 2060, 2061, 2107, 1296, 1296, 2065, 1296, + 1338, 1296, 1338, 2056, 2062, 2062, 952, 952, 962, 962, + 2115, 962, 962, 962, 962, 1296, 962, 962, 962, 962, + 2060, 2115, 1296, 2063, 2063, 962, 962, 962, 2064, 962, + + 1339, 1339, 2066, 1339, 2090, 1339, 1507, 1507, 2066, 1507, + 2067, 1507, 2064, 2070, 2068, 2070, 2074, 1167, 2067, 1339, + 2090, 1339, 2068, 2079, 2074, 1507, 962, 962, 965, 965, + 2079, 965, 965, 965, 965, 2064, 965, 965, 965, 965, + 2072, 2076, 2072, 2076, 1162, 965, 965, 965, 2078, 965, + 1340, 1340, 2085, 1340, 2077, 1340, 2085, 2078, 2084, 2087, + 2087, 1508, 1508, 2084, 1508, 2092, 1508, 2099, 2077, 1340, + 2111, 1340, 2092, 2099, 2111, 2095, 965, 965, 980, 980, + 1508, 980, 980, 980, 980, 2093, 980, 980, 980, 980, + 2077, 2095, 2098, 2088, 2097, 980, 980, 980, 2093, 980, + + 980, 2119, 1508, 1342, 1342, 2102, 1342, 2088, 1342, 2098, + 2097, 2089, 2113, 2102, 2113, 2108, 1421, 1421, 2119, 1421, + 2108, 1421, 1342, 1161, 1342, 2089, 980, 980, 981, 981, + 2088, 981, 981, 981, 981, 1421, 981, 981, 981, 981, + 2096, 1421, 1421, 2124, 2124, 981, 981, 981, 2089, 981, + 981, 1342, 1343, 1343, 2096, 1343, 2096, 1343, 2103, 2104, + 2105, 1514, 1514, 2109, 1514, 2103, 1514, 2105, 2116, 2104, + 2109, 1343, 2114, 1343, 2116, 2114, 981, 981, 991, 991, + 1514, 991, 991, 991, 991, 991, 991, 991, 991, 991, + 991, 991, 991, 991, 991, 991, 991, 991, 991, 991, + + 991, 991, 991, 991, 991, 991, 991, 991, 991, 991, + 991, 991, 991, 991, 991, 991, 991, 991, 991, 991, + 991, 991, 991, 991, 991, 991, 991, 991, 1002, 1002, + 1152, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1013, 1013, + 2110, 1013, 1013, 1013, 1013, 2125, 1013, 1013, 1013, 1013, + 2125, 2112, 2121, 2094, 2110, 1013, 1013, 1013, 2121, 1013, + + 1013, 1344, 1344, 2112, 1344, 2123, 1344, 2094, 2126, 2346, + 2117, 2110, 2126, 2128, 2128, 2123, 1422, 1422, 2132, 1422, + 1344, 1422, 1344, 2346, 2117, 2132, 1013, 1013, 1014, 1014, + 2094, 1014, 1014, 1014, 1014, 1422, 1014, 1014, 1014, 1014, + 2117, 1422, 2127, 2118, 2122, 1014, 1014, 1014, 2135, 1014, + 1014, 1345, 1345, 2136, 1345, 2133, 1345, 2118, 2122, 2136, + 2127, 2129, 2144, 2144, 1151, 2135, 1428, 1428, 2133, 1428, + 1345, 1428, 1345, 2118, 2122, 2129, 1014, 1014, 1024, 1024, + 2130, 1024, 1024, 1024, 1024, 1428, 1024, 1024, 1024, 1024, + 2157, 2157, 1145, 1428, 2130, 1024, 1024, 1024, 2129, 1024, + + 1346, 1346, 2143, 1346, 2134, 1346, 1516, 1516, 2141, 1516, + 2142, 1516, 2155, 2141, 2142, 2148, 2155, 2130, 2134, 1346, + 2143, 1346, 2148, 2152, 2156, 1516, 1024, 1024, 1026, 1026, + 2145, 1026, 1026, 1026, 1026, 2225, 1026, 1026, 1026, 1026, + 2152, 2134, 2156, 2225, 2145, 1026, 1026, 1026, 2146, 1026, + 1347, 1347, 2149, 1347, 2150, 1347, 1524, 1524, 2153, 1524, + 2162, 1524, 2146, 2161, 2153, 2149, 2158, 2145, 2150, 1347, + 2161, 1347, 2242, 2162, 2242, 1524, 1026, 1026, 1041, 1041, + 2158, 1041, 1041, 1041, 1041, 2146, 1041, 1041, 1041, 1041, + 2164, 2150, 2169, 2154, 2169, 1041, 1041, 1041, 2154, 1041, + + 1041, 1348, 1348, 2158, 1348, 2171, 1348, 2164, 2165, 2171, + 2169, 2159, 2172, 2170, 2165, 1135, 1502, 1502, 2170, 1502, + 1348, 1502, 1348, 2173, 2173, 2159, 1041, 1041, 1042, 1042, + 2172, 1042, 1042, 1042, 1042, 1502, 1042, 1042, 1042, 1042, + 2176, 1502, 1502, 2163, 2189, 1042, 1042, 1042, 2159, 1042, + 1042, 1411, 1411, 2177, 1411, 2178, 1411, 2163, 2187, 2182, + 2177, 2174, 2189, 2187, 2176, 2182, 1503, 1503, 2178, 1503, + 1411, 1503, 1411, 2190, 2190, 2174, 1042, 1042, 1052, 1052, + 2163, 1052, 1052, 1052, 1052, 1503, 1052, 1052, 1052, 1052, + 2180, 1503, 2180, 2181, 2193, 1052, 1052, 1052, 2174, 1052, + + 1052, 1412, 1412, 2188, 1412, 2262, 1412, 2188, 2180, 2199, + 2181, 2175, 2168, 2262, 2168, 2199, 1509, 1509, 2193, 1509, + 1412, 1509, 1412, 2198, 2210, 2175, 1052, 1052, 1053, 1053, + 2168, 1053, 1053, 1053, 1053, 1509, 1053, 1053, 1053, 1053, + 2198, 2210, 2168, 1509, 2195, 1053, 1053, 1053, 2175, 1053, + 1053, 1413, 1413, 2194, 1413, 2201, 1413, 2195, 2200, 2201, + 2194, 2179, 2220, 2200, 2203, 2203, 1632, 1632, 2206, 1632, + 1413, 1632, 1413, 2202, 2220, 2179, 1053, 1053, 1063, 1063, + 2191, 1063, 1063, 1063, 1063, 1632, 1063, 1063, 1063, 1063, + 2213, 2202, 2206, 2213, 2191, 1063, 1063, 1063, 2179, 1063, + + 1414, 1414, 1632, 1414, 2192, 1414, 1633, 1633, 2207, 1633, + 2208, 1633, 2212, 2350, 2211, 2207, 2212, 2191, 2192, 1414, + 2211, 1414, 2350, 2208, 2222, 1633, 1063, 1063, 1066, 1066, + 1633, 1066, 1066, 1066, 1066, 2214, 1066, 1066, 1066, 1066, + 2222, 2192, 2241, 2241, 1126, 1066, 1066, 1066, 1414, 1066, + 1415, 1415, 2214, 1415, 2196, 1415, 1634, 1634, 2216, 1634, + 2223, 1634, 2226, 2224, 2219, 2223, 2204, 2226, 2196, 1415, + 2219, 1415, 2216, 2224, 2230, 1634, 1066, 1066, 1081, 1081, + 2204, 1081, 1081, 1081, 1081, 1115, 1081, 1081, 1081, 1081, + 2230, 2196, 2227, 2205, 2216, 1081, 1081, 1081, 2227, 1081, + + 1081, 1416, 1416, 2204, 1416, 2234, 1416, 2205, 2232, 2239, + 2244, 2209, 2248, 2248, 2239, 2244, 1635, 1635, 2234, 1635, + 1416, 1635, 1416, 2235, 2232, 2209, 1081, 1081, 1082, 1082, + 2205, 1082, 1082, 1082, 1082, 1635, 1082, 1082, 1082, 1082, + 2448, 2235, 2237, 2448, 1635, 1082, 1082, 1082, 2209, 1082, + 1082, 1417, 1417, 2233, 1417, 2217, 1417, 2221, 2237, 2229, + 2263, 1636, 1636, 2251, 1636, 2263, 1636, 2233, 1087, 2217, + 1417, 2221, 1417, 2229, 2251, 2229, 1082, 1082, 1092, 1092, + 1636, 1092, 1092, 1092, 1092, 2240, 1092, 1092, 1092, 1092, + 2233, 2217, 2240, 2221, 2231, 1092, 1092, 1092, 2236, 1092, + + 1418, 1418, 2238, 1418, 2243, 1418, 1637, 1637, 2231, 1637, + 2231, 1637, 2236, 2249, 2236, 1058, 2243, 2247, 2238, 1418, + 2249, 1418, 2253, 2253, 2258, 1637, 1092, 1092, 1094, 1094, + 2258, 1094, 1094, 1094, 1094, 2247, 1094, 1094, 1094, 1094, + 2254, 2256, 2254, 2255, 2255, 1094, 1094, 1094, 2256, 1094, + 1419, 1419, 2259, 1419, 2245, 1419, 1641, 1641, 1047, 1641, + 2246, 1641, 2260, 2259, 2260, 2269, 2264, 2274, 2245, 1419, + 2269, 1419, 2264, 2274, 2246, 1641, 1094, 1094, 1109, 1109, + 2257, 1109, 1109, 1109, 1109, 2245, 1109, 1109, 1109, 1109, + 2268, 2246, 2267, 2250, 2257, 1109, 1109, 1109, 1019, 1109, + + 1109, 1420, 1420, 2266, 1420, 2267, 1420, 2250, 2268, 2286, + 2257, 1704, 1704, 2272, 1704, 2286, 1704, 2266, 2270, 1008, + 1420, 2272, 1420, 2280, 2250, 2270, 1109, 1109, 1110, 1110, + 1704, 1110, 1110, 1110, 1110, 1704, 1110, 1110, 1110, 1110, + 2266, 2280, 2279, 2273, 1003, 1110, 1110, 1110, 2273, 1110, + 1110, 1457, 1457, 2278, 1457, 2279, 1457, 2284, 2282, 996, + 2289, 1705, 1705, 2282, 1705, 2284, 1705, 2278, 2283, 2285, + 1457, 2288, 1457, 2289, 2285, 2283, 1110, 1110, 1120, 1120, + 1705, 1120, 1120, 1120, 1120, 2288, 1120, 1120, 1120, 1120, + 2278, 2290, 986, 2291, 2301, 1120, 1120, 1120, 2291, 1120, + + 1120, 1458, 1458, 2292, 1458, 2294, 1458, 2301, 2288, 2290, + 2292, 2314, 2293, 2294, 2293, 2428, 1706, 1706, 2295, 1706, + 1458, 1706, 1458, 2295, 2314, 2428, 1120, 1120, 1121, 1121, + 2293, 1121, 1121, 1121, 1121, 1706, 1121, 1121, 1121, 1121, + 2293, 2298, 2296, 2298, 1706, 1121, 1121, 1121, 2296, 1121, + 1121, 1459, 1459, 2299, 1459, 2299, 1459, 2302, 2304, 2298, + 2305, 1707, 1707, 2304, 1707, 2307, 1707, 2305, 979, 2308, + 1459, 2299, 1459, 2307, 2308, 2302, 1121, 1121, 1131, 1131, + 1707, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, + 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, + + 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, + 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, + 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1139, 1139, + 2300, 1139, 1139, 1139, 1139, 2317, 1139, 1139, 1139, 1139, + 2317, 2303, 2309, 2303, 2300, 1139, 1139, 1139, 2309, 1139, + 1139, 2333, 2315, 1461, 1461, 2313, 1461, 2319, 1461, 2303, + 2324, 1708, 1708, 2333, 1708, 2319, 1708, 2300, 2318, 2313, + 2315, 978, 1461, 2324, 1461, 2318, 1139, 1139, 1140, 1140, + 1708, 1140, 1140, 1140, 1140, 2320, 1140, 1140, 1140, 1140, + 2320, 2325, 2313, 2331, 2331, 1140, 1140, 1140, 2321, 1140, + + 1140, 1461, 1462, 1462, 2321, 1462, 2323, 1462, 2326, 2325, + 2327, 1712, 1712, 2326, 1712, 2328, 1712, 2327, 2334, 2330, + 2323, 1462, 2328, 1462, 2330, 2342, 1140, 1140, 1169, 1169, + 1712, 1169, 1169, 1169, 1169, 2334, 1169, 1169, 1169, 1169, + 2329, 2342, 969, 2323, 2329, 1169, 1169, 1169, 2335, 1169, + 1463, 1463, 2335, 1463, 2336, 1463, 1703, 1703, 2332, 1703, + 2336, 1703, 2338, 2351, 2354, 2351, 2352, 2352, 1169, 1463, + 2354, 1463, 2332, 963, 2343, 1703, 1169, 1169, 1170, 1170, + 2338, 1170, 1170, 1170, 1170, 2340, 1170, 1170, 1170, 1170, + 2343, 2344, 1703, 2345, 2332, 1170, 1170, 1170, 2340, 1170, + + 2347, 1464, 1464, 2348, 1464, 2344, 1464, 2344, 2356, 2345, + 828, 1815, 1815, 2347, 1815, 2356, 1815, 2358, 2358, 2348, + 1464, 1170, 1464, 2359, 2359, 800, 1170, 1170, 1180, 1180, + 1815, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, + 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, + 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, + 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, + 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1191, 1191, + 554, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1202, 1202, + 2339, 1202, 1202, 1202, 1202, 2429, 1202, 1202, 1202, 1202, + 523, 2349, 2357, 2429, 2339, 1202, 1202, 1202, 2341, 1202, + 1465, 1465, 2349, 1465, 2357, 1465, 1814, 1814, 2362, 1814, + 2365, 1814, 2341, 2360, 2362, 2364, 2365, 2339, 1202, 1465, + 2517, 1465, 2364, 2517, 2360, 1814, 1202, 1202, 1203, 1203, + 2361, 1203, 1203, 1203, 1203, 2341, 1203, 1203, 1203, 1203, + 2367, 1814, 2367, 2355, 2361, 1203, 1203, 1203, 2422, 1203, + + 2368, 1466, 1466, 2369, 1466, 2363, 1466, 2355, 380, 2366, + 2361, 1816, 1816, 2366, 1816, 2422, 1816, 2369, 2368, 2363, + 1466, 1203, 1466, 379, 2355, 2377, 1203, 1203, 1230, 1230, + 1816, 1230, 1230, 1230, 1230, 2363, 1230, 1230, 1230, 1230, + 2369, 2370, 1816, 2377, 2372, 1230, 1230, 1230, 2371, 1230, + 1467, 1467, 2373, 1467, 2370, 1467, 1817, 1817, 2372, 1817, + 2443, 1817, 2371, 2374, 2375, 2373, 2378, 2443, 1230, 1467, + 378, 1467, 2386, 2375, 2374, 1817, 1230, 1230, 1231, 1231, + 2378, 1231, 1231, 1231, 1231, 2371, 1231, 1231, 1231, 1231, + 2386, 2559, 2379, 2382, 2559, 1231, 1231, 1231, 2384, 1231, + + 2383, 1492, 1492, 2378, 1492, 2379, 1492, 2382, 2385, 2384, + 2388, 1872, 1872, 2383, 1872, 2458, 1872, 2385, 2433, 2433, + 1492, 1231, 1492, 2388, 2392, 2395, 1231, 1231, 1241, 1241, + 1872, 1241, 1241, 1241, 1241, 2392, 1241, 1241, 1241, 1241, + 2390, 2458, 2394, 2395, 2394, 1241, 1241, 1241, 2380, 1241, + 1493, 1493, 2391, 1493, 2390, 1493, 1871, 1871, 2393, 1871, + 2394, 1871, 2380, 2446, 2403, 2391, 2387, 2393, 1241, 1493, + 2446, 1493, 2399, 2403, 2399, 1871, 1241, 1241, 1242, 1242, + 2387, 1242, 1242, 1242, 1242, 2380, 1242, 1242, 1242, 1242, + 2399, 1871, 2397, 2400, 2410, 1242, 1242, 1242, 2402, 1242, + + 2401, 1494, 1494, 2387, 1494, 2397, 1494, 2400, 2410, 2402, + 2407, 1873, 1873, 2401, 1873, 2413, 1873, 2405, 2456, 2456, + 1494, 1242, 1494, 2407, 2413, 2414, 1242, 1242, 1271, 1271, + 1873, 1271, 1271, 1271, 1271, 2405, 1271, 1271, 1271, 1271, + 377, 2411, 1873, 2414, 2418, 1271, 1271, 1271, 2389, 1271, + 1495, 1495, 2412, 1495, 2411, 1495, 1874, 1874, 2418, 1874, + 2416, 1874, 2389, 2412, 2453, 2421, 2396, 375, 1271, 1495, + 2453, 1495, 2437, 2416, 2421, 1874, 1271, 1271, 1272, 1272, + 2396, 1272, 1272, 1272, 1272, 2389, 1272, 1272, 1272, 1272, + 2437, 374, 2432, 2435, 2419, 1272, 1272, 1272, 1495, 1272, + + 2457, 1496, 1496, 2396, 1496, 2398, 1496, 2419, 2432, 2435, + 2440, 1984, 1984, 2420, 1984, 2440, 1984, 2445, 2457, 2398, + 1496, 1272, 1496, 2424, 2420, 2445, 1272, 1272, 1299, 1299, + 1984, 1299, 1299, 1299, 1299, 2424, 1299, 1299, 1299, 1299, + 1984, 2426, 2398, 373, 2436, 1299, 1299, 1299, 2406, 1299, + 1497, 1497, 2427, 1497, 2426, 1497, 1991, 1991, 2423, 1991, + 2436, 1991, 2406, 2451, 2427, 2447, 2408, 372, 1299, 1497, + 2447, 1497, 2423, 2452, 2451, 1991, 1299, 1299, 1300, 1300, + 2408, 1300, 1300, 1300, 1300, 2406, 1300, 1300, 1300, 1300, + 2463, 2463, 2452, 2431, 2423, 1300, 1300, 1300, 2430, 1300, + + 2439, 1498, 1498, 2408, 1498, 2415, 1498, 2431, 2504, 2431, + 2430, 1996, 1996, 2439, 1996, 371, 1996, 2450, 2466, 2415, + 1498, 1300, 1498, 2441, 2504, 2450, 1300, 1300, 1310, 1310, + 1996, 1310, 1310, 1310, 1310, 2441, 1310, 1310, 1310, 1310, + 2455, 2454, 2415, 2454, 2466, 1310, 1310, 1310, 2434, 1310, + 1499, 1499, 2455, 1499, 2459, 1499, 2038, 2038, 2425, 2038, + 2442, 2038, 2434, 2518, 2434, 2449, 2417, 2459, 1310, 1499, + 2449, 1499, 2425, 2518, 2442, 2038, 1310, 1310, 1311, 1311, + 2417, 1311, 1311, 1311, 1311, 2038, 1311, 1311, 1311, 1311, + 2465, 2442, 2499, 2444, 2425, 1311, 1311, 1311, 2461, 1311, + + 2460, 1500, 1500, 2417, 1500, 2460, 1500, 2444, 2465, 2499, + 2461, 2045, 2045, 2468, 2045, 2498, 2045, 2498, 2468, 2502, + 1500, 1311, 1500, 2502, 2444, 355, 1311, 1311, 1321, 1321, + 2045, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, + 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, + 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, + 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, + 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1327, 1327, + 2467, 1327, 1327, 1327, 1327, 347, 1327, 1327, 1327, 1327, + 2469, 2470, 2470, 2467, 2471, 1327, 1327, 1327, 2472, 1327, + + 1501, 1501, 2469, 1501, 2473, 1501, 2050, 2050, 2474, 2050, + 2475, 2050, 2471, 2474, 2477, 2477, 2503, 2473, 1327, 1501, + 2503, 1501, 2475, 344, 2472, 2050, 1327, 1327, 1328, 1328, + 2479, 1328, 1328, 1328, 1328, 2482, 1328, 1328, 1328, 1328, + 2482, 2476, 2478, 2476, 2478, 1328, 1328, 1328, 2479, 1328, + 2481, 2485, 2485, 1553, 1553, 2483, 1553, 2487, 1553, 2476, + 2478, 2139, 2139, 2481, 2139, 2480, 2139, 2483, 2488, 2492, + 2492, 1328, 1553, 329, 1553, 2487, 1328, 1328, 1357, 1357, + 2139, 1357, 1357, 1357, 1357, 2489, 1357, 1357, 1357, 1357, + 2493, 2480, 2139, 2494, 2488, 1357, 1357, 1357, 2489, 1357, + + 2495, 1553, 1554, 1554, 2490, 1554, 2491, 1554, 2493, 2490, + 2496, 2140, 2140, 2495, 2140, 2496, 2140, 247, 2491, 2494, + 2519, 1554, 2519, 1554, 2497, 2505, 1357, 1357, 1358, 1358, + 2140, 1358, 1358, 1358, 1358, 2497, 1358, 1358, 1358, 1358, + 2501, 2512, 2505, 246, 2506, 1358, 1358, 1358, 2512, 1358, + 1555, 1555, 2501, 1555, 2507, 1555, 2151, 2151, 2508, 2151, + 2506, 2151, 2511, 2507, 2510, 2516, 2516, 245, 2511, 1555, + 2508, 1555, 2510, 2513, 1358, 2151, 1358, 1358, 1359, 1359, + 2526, 1359, 1359, 1359, 1359, 2513, 1359, 1359, 1359, 1359, + 2523, 2515, 2526, 2521, 2523, 1359, 1359, 1359, 2515, 1359, + + 2521, 1556, 1556, 2520, 1556, 1359, 1556, 2524, 2520, 2522, + 2522, 2186, 2186, 2528, 2186, 2529, 2186, 2534, 2567, 2529, + 1556, 2528, 1556, 2567, 2524, 2534, 1359, 1359, 1376, 1376, + 2186, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, + 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, + 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, + 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, + 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1387, 1387, + 244, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, + 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, + + 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, + 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, + 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1399, 1399, + 2532, 1399, 1399, 1399, 1399, 2525, 1399, 1399, 1399, 1399, + 2530, 242, 2532, 2531, 2525, 1399, 1399, 1399, 2536, 1399, + 1559, 1559, 2531, 1559, 2535, 1559, 2542, 2530, 2535, 2537, + 2538, 2185, 2185, 2564, 2185, 2536, 2185, 2540, 2537, 1559, + 2564, 1559, 2538, 2542, 1399, 2540, 1399, 1399, 1400, 1400, + 2185, 1400, 1400, 1400, 1400, 2546, 1400, 1400, 1400, 1400, + 2541, 2543, 2185, 2546, 2541, 1400, 1400, 1400, 1559, 1400, + + 2543, 1560, 1560, 2544, 1560, 1400, 1560, 2547, 2548, 2549, + 2553, 2547, 2550, 2554, 2553, 2544, 1983, 1983, 2549, 1983, + 1560, 1983, 1560, 241, 2550, 2548, 1400, 1400, 1429, 1429, + 2554, 1429, 1429, 1429, 1429, 1983, 1429, 1429, 1429, 1429, + 2552, 240, 2556, 2555, 1983, 1429, 1429, 1429, 2552, 1429, + 1561, 1561, 2555, 1561, 2556, 1561, 2197, 2197, 2558, 2197, + 2561, 2197, 2562, 2565, 2560, 2571, 2558, 2571, 2561, 1561, + 2565, 1561, 239, 2562, 2572, 2197, 1429, 1429, 1430, 1430, + 2560, 1430, 1430, 1430, 1430, 2572, 1430, 1430, 1430, 1430, + 2563, 2563, 2574, 2627, 2566, 1430, 1430, 1430, 2574, 1430, + + 1562, 1562, 2627, 1562, 2569, 1562, 2271, 2271, 2566, 2271, + 2573, 2271, 2639, 2573, 2575, 2576, 2578, 2576, 2569, 1562, + 2575, 1562, 2639, 2578, 1430, 2271, 1430, 1430, 1431, 1431, + 2581, 1431, 1431, 1431, 1431, 2271, 1431, 1431, 1431, 1431, + 2579, 2569, 2579, 2580, 2581, 1431, 1431, 1431, 2584, 1431, + 2580, 2590, 2582, 1623, 1623, 1431, 1623, 2583, 1623, 2582, + 2581, 2587, 2584, 2585, 2583, 2590, 2037, 2037, 2585, 2037, + 238, 2037, 1623, 2589, 1623, 2587, 1431, 1431, 1445, 1445, + 2589, 1445, 1445, 1445, 1445, 2037, 1445, 1445, 1445, 1445, + 2622, 2622, 234, 2595, 2037, 1445, 1445, 1445, 2587, 1445, + + 2595, 1623, 1624, 1624, 2591, 1624, 2593, 1624, 2596, 2591, + 2597, 2276, 2276, 2619, 2276, 2597, 2276, 233, 2601, 2619, + 2593, 1624, 2596, 1624, 1445, 2601, 1445, 1445, 1446, 1446, + 2276, 1446, 1446, 1446, 1446, 2603, 1446, 1446, 1446, 1446, + 2603, 2607, 232, 2593, 2602, 1446, 1446, 1446, 2607, 1446, + 2620, 1625, 1625, 2599, 1625, 1446, 1625, 2605, 2602, 2608, + 2609, 2277, 2277, 2620, 2277, 2609, 2277, 2599, 2613, 2615, + 1625, 2605, 1625, 2608, 2615, 2613, 1446, 1446, 1476, 1476, + 2277, 1476, 1476, 1476, 1476, 2633, 1476, 1476, 1476, 1476, + 2599, 2624, 2624, 2633, 2605, 1476, 1476, 1476, 2611, 1476, + + 1626, 1626, 2614, 1626, 2617, 1626, 2281, 2281, 2623, 2281, + 2621, 2281, 2611, 2625, 2621, 2640, 2614, 2640, 2617, 1626, + 2625, 1626, 2623, 2626, 2635, 2281, 1476, 1476, 1477, 1477, + 2635, 1477, 1477, 1477, 1477, 2611, 1477, 1477, 1477, 1477, + 2626, 2617, 2630, 2628, 2623, 1477, 1477, 1477, 2629, 1477, + 1628, 1628, 229, 1628, 2631, 1628, 2306, 2306, 2630, 2306, + 2628, 2306, 2629, 2681, 2629, 2632, 2632, 2681, 2631, 1628, + 2641, 1628, 2634, 2634, 1477, 2306, 1477, 1477, 1478, 1478, + 2641, 1478, 1478, 1478, 1478, 2306, 1478, 1478, 1478, 1478, + 228, 2631, 2644, 2636, 2637, 1478, 1478, 1478, 1628, 1478, + + 2637, 1629, 1629, 2643, 1629, 1478, 1629, 2636, 2645, 2644, + 2643, 2311, 2311, 2676, 2311, 2678, 2311, 2645, 2646, 2676, + 1629, 227, 1629, 2678, 2636, 2649, 1478, 1478, 1510, 1510, + 2311, 1510, 1510, 1510, 1510, 2646, 1510, 1510, 1510, 1510, + 2642, 2690, 2649, 2650, 2690, 1510, 1510, 1510, 2647, 1510, + 1630, 1630, 2650, 1630, 2642, 1630, 2312, 2312, 2648, 2312, + 2654, 2312, 2647, 2651, 2694, 2648, 2725, 2654, 2725, 1630, + 2642, 1630, 2694, 2655, 2657, 2312, 1510, 1510, 1511, 1511, + 2651, 1511, 1511, 1511, 1511, 2647, 1511, 1511, 1511, 1511, + 2655, 2657, 2663, 2656, 2663, 1511, 1511, 1511, 2653, 1511, + + 1631, 1631, 2656, 1631, 2658, 1631, 2316, 2316, 2659, 2316, + 2663, 2316, 2653, 2660, 2661, 2659, 2682, 2682, 2658, 1631, + 2726, 1631, 2726, 2661, 1511, 2316, 1511, 1511, 1512, 1512, + 2660, 1512, 1512, 1512, 1512, 2653, 1512, 1512, 1512, 1512, + 2662, 2658, 2666, 2665, 216, 1512, 1512, 1512, 2668, 1512, + 2665, 2667, 2672, 1664, 1664, 1512, 1664, 2662, 1664, 2666, + 2667, 2376, 2376, 2671, 2376, 2668, 2376, 2683, 2683, 2672, + 2671, 2664, 1664, 2674, 1664, 2729, 1512, 1512, 1526, 1526, + 2376, 1526, 1526, 1526, 1526, 2664, 1526, 1526, 1526, 1526, + 2674, 2673, 2729, 2677, 2679, 1526, 1526, 1526, 2742, 1526, + + 2673, 1664, 1665, 1665, 2670, 1665, 2675, 1665, 2664, 2677, + 2679, 2381, 2381, 2697, 2381, 2742, 2381, 2697, 2670, 2685, + 2675, 1665, 2693, 1665, 1526, 2693, 1526, 1526, 1527, 1527, + 2381, 1527, 1527, 1527, 1527, 2685, 1527, 1527, 1527, 1527, + 215, 2670, 2695, 2675, 2687, 1527, 1527, 1527, 2689, 1527, + 2695, 1666, 1666, 2686, 1666, 1527, 1666, 2684, 2684, 2689, + 2687, 2404, 2404, 2696, 2404, 2724, 2404, 2686, 2724, 2686, + 1666, 2696, 1666, 2688, 2688, 214, 1527, 1527, 1538, 1538, + 2404, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1541, 1541, + 2680, 1541, 1541, 1541, 1541, 213, 1541, 1541, 1541, 1541, + 2740, 2691, 2698, 2698, 2680, 1541, 1541, 1541, 2740, 1541, + 1667, 1667, 2691, 1667, 2692, 1667, 2409, 2409, 2727, 2409, + 2727, 2409, 2699, 2699, 2700, 2700, 2680, 211, 2692, 1667, + 2738, 1667, 2702, 2702, 1541, 2409, 1541, 1541, 1542, 1542, + 2738, 1542, 1542, 1542, 1542, 2692, 1542, 1542, 1542, 1542, + 2701, 2703, 2703, 210, 2701, 1542, 1542, 1542, 2706, 1542, + + 2704, 2704, 2706, 1670, 1670, 1542, 1670, 2732, 1670, 2707, + 2707, 2462, 2462, 2733, 2462, 2733, 2462, 2708, 2708, 2709, + 2709, 2710, 1670, 2732, 1670, 2710, 1542, 1542, 1557, 1557, + 2462, 1557, 1557, 1557, 1557, 209, 1557, 1557, 1557, 1557, + 2711, 2711, 2712, 2712, 2715, 1557, 1557, 1557, 2715, 1557, + 208, 1670, 1671, 1671, 2714, 1671, 2714, 1671, 2713, 2713, + 2765, 2464, 2464, 207, 2464, 2765, 2464, 2716, 2716, 2717, + 2717, 1671, 2714, 1671, 2718, 2718, 1557, 1557, 1558, 1558, + 2464, 1558, 1558, 1558, 1558, 200, 1558, 1558, 1558, 1558, + 2720, 2721, 2721, 199, 2720, 1558, 1558, 1558, 2728, 1558, + + 1672, 1672, 2728, 1672, 2730, 1672, 2484, 2484, 197, 2484, + 2739, 2484, 2722, 2722, 2723, 2723, 2731, 2731, 2730, 1672, + 2768, 1672, 2768, 2734, 2739, 2484, 1558, 1558, 1569, 1569, + 2734, 1569, 1569, 1569, 1569, 2735, 1569, 1569, 1569, 1569, + 2739, 2730, 2735, 2737, 2741, 1569, 1569, 1569, 2741, 1569, + 1673, 1673, 196, 1673, 2737, 1673, 2486, 2486, 2736, 2486, + 2745, 2486, 2744, 2744, 2745, 2736, 2748, 2748, 2746, 1673, + 2749, 1673, 195, 2750, 2749, 2486, 1569, 1569, 1570, 1570, + 2743, 1570, 1570, 1570, 1570, 2746, 1570, 1570, 1570, 1570, + 2750, 2752, 2752, 2754, 2743, 1570, 1570, 1570, 2753, 1570, + + 1694, 1694, 2753, 1694, 2747, 1694, 2652, 2652, 2766, 2652, + 2754, 2652, 1570, 2756, 2756, 2777, 2757, 2743, 2747, 1694, + 2757, 1694, 2777, 2758, 2766, 2652, 1570, 1570, 1571, 1571, + 2767, 1571, 1571, 1571, 1571, 2762, 1571, 1571, 1571, 1571, + 2758, 2747, 2760, 2760, 2767, 1571, 1571, 1571, 1694, 1571, + 1695, 1695, 2762, 1695, 2761, 1695, 2669, 2669, 2761, 2669, + 2774, 2669, 2764, 2764, 2772, 192, 2767, 1571, 2780, 1695, + 2774, 1695, 2773, 2773, 2780, 2669, 1571, 1571, 1587, 1587, + 2772, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, + 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, + + 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, + 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, + 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1599, 1599, + 191, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1611, 1611, + 2751, 1611, 1611, 1611, 1611, 2813, 1611, 1611, 1611, 1611, + 2813, 2775, 2783, 2783, 2751, 1611, 1611, 1611, 190, 1611, + + 1696, 1696, 2775, 1696, 2755, 1696, 2705, 2705, 2771, 2705, + 189, 2705, 1611, 2787, 2787, 2790, 2790, 2751, 2755, 1696, + 183, 1696, 2771, 182, 2771, 2705, 1611, 1611, 1612, 1612, + 2778, 1612, 1612, 1612, 1612, 178, 1612, 1612, 1612, 1612, + 2793, 2755, 2793, 177, 2778, 1612, 1612, 1612, 2759, 1612, + 1697, 1697, 176, 1697, 2763, 1697, 2719, 2719, 2793, 2719, + 2778, 2719, 2759, 2794, 2794, 2798, 2798, 1612, 2763, 1697, + 173, 1697, 2801, 2801, 172, 2719, 1612, 1612, 1627, 1627, + 2769, 1627, 1627, 1627, 1627, 2759, 1627, 1627, 1627, 1627, + 2779, 2763, 2776, 2770, 2769, 1627, 1627, 1627, 2781, 1627, + + 1699, 1699, 2805, 1699, 2779, 1699, 2776, 2770, 2802, 2806, + 2827, 2827, 2781, 171, 155, 69, 2805, 2769, 2805, 1699, + 2779, 1699, 2802, 2776, 2808, 2806, 1627, 1627, 1638, 1638, + 2770, 1638, 1638, 1638, 1638, 2781, 1638, 1638, 1638, 1638, + 2808, 68, 67, 2782, 2802, 1638, 1638, 1638, 1699, 1638, + 1700, 1700, 2814, 1700, 2784, 1700, 2785, 2782, 2803, 2814, + 2831, 2788, 64, 63, 62, 59, 2831, 58, 2784, 1700, + 2785, 1700, 2803, 57, 2809, 2788, 1638, 1638, 1639, 1639, + 2782, 1639, 1639, 1639, 1639, 38, 1639, 1639, 1639, 1639, + 2809, 2784, 34, 2785, 2803, 1639, 1639, 1639, 2788, 1639, + + 1701, 1701, 31, 1701, 2789, 1701, 2786, 2786, 2807, 2786, + 25, 2786, 1639, 0, 2828, 0, 0, 0, 2789, 1701, + 0, 1701, 2807, 0, 2807, 2786, 1639, 1639, 1640, 1640, + 2828, 1640, 1640, 1640, 1640, 0, 1640, 1640, 1640, 1640, + 2820, 2789, 2820, 2791, 2829, 1640, 1640, 1640, 2792, 1640, + 1702, 1702, 0, 1702, 2795, 1702, 2796, 2791, 2820, 2811, + 2829, 2799, 2792, 0, 0, 0, 0, 1640, 2795, 1702, + 2796, 1702, 0, 2811, 0, 2799, 1640, 1640, 1652, 1652, + 2791, 1652, 1652, 1652, 1652, 2792, 1652, 1652, 1652, 1652, + 2811, 2795, 2821, 2796, 2821, 1652, 1652, 1652, 2799, 1652, + + 1919, 1919, 0, 1919, 2800, 1919, 2797, 2797, 2840, 2797, + 2821, 2797, 1652, 0, 0, 0, 0, 0, 2800, 1919, + 0, 1919, 2840, 0, 2840, 2797, 1652, 1652, 1653, 1653, + 2812, 1653, 1653, 1653, 1653, 0, 1653, 1653, 1653, 1653, + 2832, 2800, 2842, 2830, 2812, 1653, 1653, 1653, 2833, 1653, + 1981, 1981, 2841, 1981, 2832, 1981, 2842, 2830, 2839, 2846, + 0, 2812, 2833, 0, 0, 0, 0, 1653, 2841, 1981, + 2832, 1981, 2839, 2842, 0, 2846, 1653, 1653, 1668, 1668, + 2830, 1668, 1668, 1668, 1668, 2833, 1668, 1668, 1668, 1668, + 2844, 0, 2844, 0, 2839, 1668, 1668, 1668, 2834, 1668, + + 2015, 2015, 0, 2015, 2835, 2015, 2816, 2816, 2844, 2816, + 0, 2816, 2834, 0, 0, 0, 0, 0, 2835, 2015, + 0, 2015, 0, 0, 0, 2816, 1668, 1668, 1669, 1669, + 2836, 1669, 1669, 1669, 1669, 2834, 1669, 1669, 1669, 1669, + 0, 2835, 0, 0, 2836, 1669, 1669, 1669, 2837, 1669, + 2035, 2035, 0, 2035, 2838, 2035, 2817, 2817, 0, 2817, + 0, 2817, 2837, 0, 0, 0, 0, 2836, 2838, 2035, + 0, 2035, 0, 0, 0, 2817, 1669, 1669, 1680, 1680, + 0, 1680, 1680, 1680, 1680, 2837, 1680, 1680, 1680, 1680, + 0, 2838, 0, 0, 0, 1680, 1680, 1680, 0, 1680, + + 2080, 2080, 0, 2080, 0, 2080, 2823, 2823, 0, 2823, + 0, 2823, 0, 0, 0, 0, 0, 0, 0, 2080, + 0, 2080, 0, 0, 0, 2823, 1680, 1680, 1681, 1681, + 0, 1681, 1681, 1681, 1681, 0, 1681, 1681, 1681, 1681, + 0, 0, 0, 0, 0, 1681, 1681, 1681, 0, 1681, + 2081, 2081, 0, 2081, 0, 2081, 2824, 2824, 0, 2824, + 0, 2824, 1681, 0, 0, 0, 0, 0, 0, 2081, + 0, 2081, 0, 0, 0, 2824, 1681, 1681, 1682, 1682, + 0, 1682, 1682, 1682, 1682, 0, 1682, 1682, 1682, 1682, + 0, 0, 0, 0, 0, 1682, 1682, 1682, 0, 1682, + + 2137, 2137, 0, 2137, 0, 2137, 2843, 2843, 0, 2843, + 0, 2843, 0, 0, 0, 0, 0, 1682, 0, 2137, + 0, 2137, 0, 0, 0, 2843, 1682, 1682, 1698, 1698, + 0, 1698, 1698, 1698, 1698, 0, 1698, 1698, 1698, 1698, + 0, 0, 0, 0, 0, 1698, 1698, 1698, 0, 1698, + 2138, 2138, 0, 2138, 0, 2138, 2845, 2845, 0, 2845, + 0, 2845, 0, 0, 0, 0, 0, 0, 0, 2138, + 0, 2138, 0, 0, 0, 2845, 1698, 1698, 1709, 1709, + 0, 1709, 1709, 1709, 1709, 0, 1709, 1709, 1709, 1709, + 0, 0, 0, 0, 0, 1709, 1709, 1709, 0, 1709, + + 2166, 2166, 0, 2166, 0, 2166, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2166, + 0, 2166, 0, 0, 0, 0, 1709, 1709, 1710, 1710, + 0, 1710, 1710, 1710, 1710, 0, 1710, 1710, 1710, 1710, + 0, 0, 0, 0, 0, 1710, 1710, 1710, 0, 1710, + 2167, 2167, 0, 2167, 0, 2167, 0, 0, 0, 0, + 0, 0, 1710, 0, 0, 0, 0, 0, 0, 2167, + 0, 2167, 0, 0, 0, 0, 1710, 1710, 1711, 1711, + 0, 1711, 1711, 1711, 1711, 0, 1711, 1711, 1711, 1711, + 0, 0, 0, 0, 0, 1711, 1711, 1711, 0, 1711, + + 2183, 2183, 0, 2183, 0, 2183, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1711, 0, 2183, + 0, 2183, 0, 0, 0, 0, 1711, 1711, 1723, 1723, + 0, 1723, 1723, 1723, 1723, 0, 1723, 1723, 1723, 1723, + 0, 0, 0, 0, 0, 1723, 1723, 1723, 0, 1723, + 2184, 2184, 0, 2184, 0, 2184, 0, 0, 0, 0, + 0, 0, 1723, 0, 0, 0, 0, 0, 0, 2184, + 0, 2184, 0, 0, 0, 0, 1723, 1723, 1724, 1724, + 0, 1724, 1724, 1724, 1724, 0, 1724, 1724, 1724, 1724, + 0, 0, 0, 0, 0, 1724, 1724, 1724, 0, 1724, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1724, 0, 0, + 0, 0, 0, 0, 0, 0, 1724, 1724, 1735, 1735, + 0, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, + 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, + 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, + 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, + 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1736, 1736, + 0, 1736, 1736, 1736, 1736, 0, 1736, 1736, 1736, 1736, + 0, 0, 0, 0, 0, 1736, 1736, 1736, 0, 1736, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1736, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1736, 1736, 1737, 1737, + 0, 1737, 1737, 1737, 1737, 0, 1737, 1737, 1737, 1737, + 0, 0, 0, 0, 0, 1737, 1737, 1737, 0, 1737, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1737, 0, 0, + 0, 0, 0, 0, 0, 0, 1737, 1737, 1748, 1748, + 0, 1748, 1748, 1748, 1748, 0, 1748, 1748, 1748, 1748, + 0, 0, 0, 0, 0, 1748, 1748, 1748, 0, 1748, + + 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, 1748, 1748, 1749, 1749, + 0, 1749, 1749, 1749, 1749, 0, 1749, 1749, 1749, 1749, + 0, 0, 0, 0, 0, 1749, 1749, 1749, 0, 1749, + 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, 1749, 1749, 1750, 1750, + 0, 1750, 1750, 1750, 1750, 0, 1750, 1750, 1750, 1750, + 0, 0, 0, 0, 0, 1750, 1750, 1750, 0, 1750, + + 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, 1750, 1750, 1751, 1751, + 0, 1751, 1751, 1751, 1751, 0, 1751, 1751, 1751, 1751, + 0, 0, 0, 0, 0, 1751, 1751, 1751, 0, 1751, + 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, 1751, 1751, 1756, 1756, + 0, 1756, 1756, 1756, 1756, 0, 1756, 1756, 1756, 1756, + 0, 0, 0, 0, 0, 1756, 1756, 1756, 0, 1756, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1756, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1756, 1756, 1757, 1757, + 0, 1757, 1757, 1757, 1757, 0, 1757, 1757, 1757, 1757, + 0, 0, 0, 0, 0, 1757, 1757, 1757, 0, 1757, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1757, 0, + 0, 0, 0, 0, 0, 0, 1757, 1757, 1771, 1771, + 0, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, + 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1783, 1783, + 0, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, + 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1797, 1797, + 0, 1797, 1797, 1797, 1797, 0, 1797, 1797, 1797, 1797, + 0, 0, 0, 0, 0, 1797, 1797, 1797, 0, 1797, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1797, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1797, 1797, 1798, 1798, + 0, 1798, 1798, 1798, 1798, 0, 1798, 1798, 1798, 1798, + 0, 0, 0, 0, 0, 1798, 1798, 1798, 0, 1798, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1798, 0, + 0, 0, 0, 0, 0, 0, 1798, 1798, 1811, 1811, + 0, 1811, 1811, 1811, 1811, 0, 1811, 1811, 1811, 1811, + 0, 0, 0, 0, 0, 1811, 1811, 1811, 0, 1811, + + 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, 1811, 1811, 1812, 1812, + 0, 1812, 1812, 1812, 1812, 0, 1812, 1812, 1812, 1812, + 0, 0, 0, 0, 0, 1812, 1812, 1812, 0, 1812, + 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, 1812, 1812, 1813, 1813, + 0, 1813, 1813, 1813, 1813, 0, 1813, 1813, 1813, 1813, + 0, 0, 0, 0, 0, 1813, 1813, 1813, 0, 1813, + + 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, 1813, 1813, 1818, 1818, + 0, 1818, 1818, 1818, 1818, 0, 1818, 1818, 1818, 1818, + 0, 0, 0, 0, 0, 1818, 1818, 1818, 0, 1818, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1818, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1818, 1818, 1819, 1819, + 0, 1819, 1819, 1819, 1819, 0, 1819, 1819, 1819, 1819, + 0, 0, 0, 0, 0, 1819, 1819, 1819, 0, 1819, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1819, 0, + 0, 0, 0, 0, 0, 0, 1819, 1819, 1832, 1832, + 0, 1832, 1832, 1832, 1832, 0, 1832, 1832, 1832, 1832, + 0, 0, 0, 0, 0, 1832, 1832, 1832, 0, 1832, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1832, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1832, 1832, 1833, 1833, + 0, 1833, 1833, 1833, 1833, 0, 1833, 1833, 1833, 1833, + 0, 0, 0, 0, 0, 1833, 1833, 1833, 0, 1833, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1833, 0, + 0, 0, 0, 0, 0, 0, 1833, 1833, 1846, 1846, + 0, 1846, 1846, 1846, 1846, 0, 1846, 1846, 1846, 1846, + 0, 0, 0, 0, 0, 1846, 1846, 1846, 0, 1846, + 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, 1846, 1846, 1847, 1847, + 0, 1847, 1847, 1847, 1847, 0, 1847, 1847, 1847, 1847, + 0, 0, 0, 0, 0, 1847, 1847, 1847, 0, 1847, + + 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, 1847, 1847, 1848, 1848, + 0, 1848, 1848, 1848, 1848, 0, 1848, 1848, 1848, 1848, + 0, 0, 0, 0, 0, 1848, 1848, 1848, 0, 1848, + 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, 1848, 1848, 1849, 1849, + 0, 1849, 1849, 1849, 1849, 0, 1849, 1849, 1849, 1849, + 0, 0, 0, 0, 0, 1849, 1849, 1849, 0, 1849, + + 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, 1849, 1849, 1854, 1854, + 0, 1854, 1854, 1854, 1854, 0, 1854, 1854, 1854, 1854, + 0, 0, 0, 0, 0, 1854, 1854, 1854, 0, 1854, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1854, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1854, 1854, 1855, 1855, + 0, 1855, 1855, 1855, 1855, 0, 1855, 1855, 1855, 1855, + 0, 0, 0, 0, 0, 1855, 1855, 1855, 0, 1855, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1855, 0, + 0, 0, 0, 0, 0, 0, 1855, 1855, 1868, 1868, + 0, 1868, 1868, 1868, 1868, 0, 1868, 1868, 1868, 1868, + 0, 0, 0, 0, 0, 1868, 1868, 1868, 0, 1868, + 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, 1868, 1868, 1869, 1869, + 0, 1869, 1869, 1869, 1869, 0, 1869, 1869, 1869, 1869, + 0, 0, 0, 0, 0, 1869, 1869, 1869, 0, 1869, + + 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, 1869, 1869, 1870, 1870, + 0, 1870, 1870, 1870, 1870, 0, 1870, 1870, 1870, 1870, + 0, 0, 0, 0, 0, 1870, 1870, 1870, 0, 1870, + 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, 1870, 1870, 1875, 1875, + 0, 1875, 1875, 1875, 1875, 0, 1875, 1875, 1875, 1875, + 0, 0, 0, 0, 0, 1875, 1875, 1875, 0, 1875, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1875, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1875, 1875, 1876, 1876, + 0, 1876, 1876, 1876, 1876, 0, 1876, 1876, 1876, 1876, + 0, 0, 0, 0, 0, 1876, 1876, 1876, 0, 1876, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1876, 0, + 0, 0, 0, 0, 0, 0, 1876, 1876, 1889, 1889, + 0, 1889, 1889, 1889, 1889, 0, 1889, 1889, 1889, 1889, + 0, 0, 0, 0, 0, 1889, 1889, 1889, 0, 1889, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1889, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1889, 1889, 1890, 1890, + 0, 1890, 1890, 1890, 1890, 0, 1890, 1890, 1890, 1890, + 0, 0, 0, 0, 0, 1890, 1890, 1890, 0, 1890, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1890, 0, + 0, 0, 0, 0, 0, 0, 1890, 1890, 1917, 1917, + 0, 1917, 1917, 1917, 1917, 0, 1917, 1917, 1917, 1917, + 0, 0, 0, 0, 0, 1917, 1917, 1917, 0, 1917, + + 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, 1917, 1917, 1920, 1920, + 0, 1920, 1920, 1920, 1920, 0, 1920, 1920, 1920, 1920, + 0, 0, 0, 0, 0, 1920, 1920, 1920, 0, 1920, + 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, 1920, 1920, 1980, 1980, + 0, 1980, 1980, 1980, 1980, 0, 1980, 1980, 1980, 1980, + 0, 0, 0, 0, 0, 1980, 1980, 1980, 0, 1980, + + 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, 1980, 1980, 1982, 1982, + 0, 1982, 1982, 1982, 1982, 0, 1982, 1982, 1982, 1982, + 0, 0, 0, 0, 0, 1982, 1982, 1982, 0, 1982, + 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, 1982, 1982, 2013, 2013, + 0, 2013, 2013, 2013, 2013, 0, 2013, 2013, 2013, 2013, + 0, 0, 0, 0, 0, 2013, 2013, 2013, 0, 2013, + + 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, 2013, 2013, 2016, 2016, + 0, 2016, 2016, 2016, 2016, 0, 2016, 2016, 2016, 2016, + 0, 0, 0, 0, 0, 2016, 2016, 2016, 0, 2016, + 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, 2016, 2016, 2034, 2034, + 0, 2034, 2034, 2034, 2034, 0, 2034, 2034, 2034, 2034, + 0, 0, 0, 0, 0, 2034, 2034, 2034, 0, 2034, + + 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, 2034, 2034, 2036, 2036, + 0, 2036, 2036, 2036, 2036, 0, 2036, 2036, 2036, 2036, + 0, 0, 0, 0, 0, 2036, 2036, 2036, 0, 2036, + 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, 2036, 2036, 2848, 2848, + 2848, 2848, 2848, 2848, 2848, 2849, 2849, 2849, 2849, 2849, + 2849, 2849, 2850, 2850, 2850, 2850, 2850, 2850, 2850, 2851, + + 2851, 2851, 2851, 2851, 2851, 2851, 2852, 2852, 2852, 2852, + 2852, 2852, 2852, 2853, 2853, 2853, 2853, 2853, 2853, 2853, + 2854, 2854, 0, 2854, 2854, 2854, 2854, 2856, 2856, 0, + 2856, 2856, 2856, 2856, 2857, 2857, 0, 2857, 2857, 2857, + 2857, 2858, 2858, 0, 2858, 2858, 2858, 2858, 2859, 2859, + 0, 2859, 2859, 2859, 2859, 2860, 2860, 0, 2860, 0, + 2860, 2861, 0, 2861, 2863, 2863, 0, 2863, 2863, 2863, + 2863, 2864, 2864, 2864, 2864, 2865, 2865, 2865, 2865, 2866, + 2866, 0, 2866, 2866, 2866, 2866, 2867, 2867, 0, 2867, + 2867, 2867, 2867, 2868, 2868, 0, 2868, 2868, 2868, 2868, + + 2870, 2870, 0, 2870, 2870, 2870, 2870, 2871, 0, 0, + 2871, 2871, 2871, 2871, 2872, 2872, 0, 2872, 2872, 2872, + 2872, 2873, 0, 0, 2873, 2873, 2873, 2873, 2874, 2874, + 0, 2874, 2874, 2874, 2874, 2875, 2875, 0, 2875, 2875, + 2875, 2875, 2876, 2876, 0, 2876, 2876, 2876, 2876, 2877, + 2877, 0, 2877, 2877, 2877, 2877, 2878, 2878, 2878, 2878, + 2879, 2879, 2879, 2879, 2880, 2880, 0, 2880, 2880, 2880, + 2880, 2881, 2881, 0, 2881, 2881, 2881, 2881, 2882, 2882, + 0, 2882, 2882, 2882, 2882, 2883, 2883, 2884, 2884, 2885, + 2885, 0, 2885, 2885, 2885, 2885, 2886, 2886, 0, 2886, + + 2886, 2886, 2886, 2889, 2889, 0, 2889, 2889, 2889, 2889, + 2890, 2890, 0, 2890, 2890, 2890, 2890, 2891, 2891, 0, + 2891, 2891, 2891, 2891, 2892, 2892, 0, 2892, 2892, 2892, + 2892, 2893, 2893, 0, 2893, 2893, 2893, 2893, 2894, 2894, + 0, 2894, 2894, 2894, 2894, 2895, 2895, 0, 2895, 2895, + 2895, 2895, 2896, 2896, 0, 2896, 0, 2896, 2897, 0, + 2897, 2899, 2899, 0, 2899, 2899, 2899, 2899, 2900, 2900, + 2900, 2900, 2901, 2901, 2901, 2901, 2902, 2902, 0, 2902, + 2902, 2902, 2902, 2903, 2903, 0, 2903, 2903, 2903, 2903, + 2904, 2904, 0, 2904, 2904, 2904, 2904, 2905, 2905, 0, + + 2905, 2905, 2905, 2905, 2906, 2906, 0, 2906, 2906, 2906, + 2906, 2907, 2907, 0, 2907, 2907, 2907, 2907, 2909, 2909, + 0, 2909, 2909, 2909, 2909, 2910, 0, 0, 2910, 2910, + 2910, 2910, 2911, 2911, 0, 2911, 2911, 2911, 2911, 2912, + 0, 0, 2912, 2912, 2912, 2912, 2913, 2913, 0, 2913, + 2913, 2913, 2913, 2914, 2914, 0, 2914, 2914, 2914, 2914, + 2915, 2915, 0, 2915, 2915, 2915, 2915, 2916, 2916, 0, + 2916, 2916, 2916, 2916, 2917, 2917, 0, 2917, 2917, 2917, + 2917, 2918, 2918, 0, 2918, 2918, 2918, 2918, 2919, 2919, + 0, 2919, 2919, 2919, 2919, 2920, 2920, 2920, 2920, 2921, + + 2921, 2921, 2921, 2922, 2922, 0, 2922, 2922, 2922, 2922, + 2923, 2923, 0, 2923, 2923, 2923, 2923, 2924, 2924, 0, + 2924, 2924, 2924, 2924, 2925, 2925, 0, 2925, 2925, 2925, + 2925, 2926, 2926, 0, 2926, 2926, 2926, 2926, 2927, 2927, + 0, 2927, 2927, 2927, 2927, 2928, 2928, 2929, 2929, 2930, + 2930, 0, 2930, 2930, 2930, 2930, 2931, 2931, 0, 2931, + 2931, 2931, 2931, 2933, 2933, 0, 2933, 2933, 2933, 2933, + 2934, 2934, 0, 2934, 2934, 2934, 2934, 2935, 2935, 0, + 2935, 2935, 2935, 2935, 2936, 2936, 0, 2936, 2936, 2936, + 2936, 2937, 2937, 0, 2937, 2937, 2937, 2937, 2938, 2938, + + 0, 2938, 2938, 2938, 2938, 2939, 2939, 0, 2939, 2939, + 2939, 2939, 2940, 2940, 0, 2940, 2940, 2940, 2940, 2941, + 2941, 0, 2941, 2941, 2941, 2941, 2942, 2942, 0, 2942, + 2942, 2942, 2942, 2943, 2943, 0, 2943, 2943, 2943, 2943, + 2944, 2944, 0, 2944, 2944, 2944, 2944, 2945, 2945, 0, + 2945, 2945, 2945, 2945, 2946, 2946, 0, 2946, 2946, 2946, + 2946, 2947, 2947, 0, 2947, 2947, 2947, 2947, 2948, 2948, + 0, 2948, 2948, 2948, 2948, 2949, 2949, 0, 2949, 2949, + 2949, 2949, 2950, 2950, 0, 2950, 2950, 2950, 2950, 2951, + 2951, 0, 2951, 2951, 2951, 2951, 2952, 2952, 0, 2952, + + 2952, 2952, 2952, 2953, 2953, 0, 2953, 2953, 2953, 2953, + 2954, 2954, 0, 2954, 2954, 2954, 2954, 2955, 2955, 0, + 2955, 2955, 2955, 2955, 2956, 2956, 0, 2956, 2956, 2956, + 2956, 2957, 2957, 0, 2957, 2957, 2957, 2957, 2958, 2958, + 0, 2958, 2958, 2958, 2958, 2959, 2959, 0, 2959, 2959, + 2959, 2959, 2960, 2960, 0, 2960, 2960, 2960, 2960, 2961, + 2961, 0, 2961, 2961, 2961, 2961, 2962, 2962, 0, 2962, + 2962, 2962, 2962, 2963, 2963, 2963, 2963, 2964, 2964, 0, + 2964, 2964, 2964, 2964, 2965, 2965, 0, 2965, 2965, 2965, + 2965, 2966, 2966, 0, 2966, 2966, 2966, 2966, 2967, 2967, + + 0, 2967, 2967, 2967, 2967, 2968, 2968, 0, 2968, 2968, + 2968, 2968, 2969, 2969, 0, 2969, 2969, 2969, 2969, 2970, + 2970, 0, 2970, 2970, 2970, 2970, 2971, 2971, 0, 2971, + 2971, 2971, 2971, 2972, 2972, 0, 2972, 2972, 2972, 2972, + 2973, 2973, 0, 2973, 2973, 2973, 2973, 2974, 2974, 0, + 2974, 2974, 2974, 2974, 2975, 2975, 0, 2975, 2975, 2975, + 2975, 2976, 2976, 0, 2976, 2976, 2976, 2976, 2977, 2977, + 0, 2977, 2977, 2977, 2977, 2978, 2978, 0, 2978, 2978, + 2978, 2978, 2979, 2979, 0, 2979, 2979, 2979, 2979, 2980, + 2980, 0, 2980, 2980, 2980, 2980, 2981, 2981, 0, 2981, + + 2981, 2981, 2981, 2982, 2982, 0, 2982, 2982, 2982, 2982, + 2983, 2983, 0, 2983, 2983, 2983, 2983, 2984, 2984, 0, + 2984, 2984, 2984, 2984, 2985, 2985, 0, 2985, 2985, 2985, + 2985, 2986, 2986, 0, 2986, 2986, 2986, 2986, 2987, 2987, + 0, 2987, 2987, 2987, 2987, 2988, 2988, 0, 2988, 2988, + 2988, 2988, 2989, 2989, 0, 2989, 2989, 2989, 2989, 2990, + 2990, 0, 2990, 2990, 2990, 2990, 2991, 2991, 0, 2991, + 2991, 2991, 2991, 2992, 2992, 0, 2992, 2992, 2992, 2992, + 2993, 2993, 0, 2993, 2993, 2993, 2993, 2994, 2994, 0, + 2994, 2994, 2994, 2994, 2995, 2995, 0, 2995, 2995, 2995, + + 2995, 2996, 2996, 0, 2996, 2996, 2996, 2996, 2997, 2997, + 0, 2997, 2997, 2997, 2997, 2998, 2998, 0, 2998, 2998, + 2998, 2998, 2999, 2999, 0, 2999, 2999, 2999, 2999, 3000, + 3000, 0, 3000, 3000, 3000, 3000, 3001, 3001, 0, 3001, + 3001, 3001, 3001, 3002, 3002, 0, 3002, 3002, 3002, 3002, + 3003, 3003, 3003, 3003, 3004, 3004, 0, 3004, 3004, 3004, + 3004, 3005, 3005, 0, 3005, 3005, 3005, 3005, 3006, 3006, + 0, 3006, 3006, 3006, 3006, 3007, 3007, 0, 3007, 3007, + 3007, 3007, 3008, 3008, 0, 3008, 3008, 3008, 3008, 3009, + 3009, 0, 3009, 3009, 3009, 3009, 3010, 3010, 0, 3010, + + 3010, 3010, 3010, 3011, 3011, 0, 3011, 3011, 3011, 3011, + 3012, 3012, 0, 3012, 3012, 3012, 3012, 3013, 3013, 0, + 3013, 3013, 3013, 3013, 3014, 3014, 0, 3014, 3014, 3014, + 3014, 3015, 3015, 0, 3015, 3015, 3015, 3015, 3016, 3016, + 0, 3016, 3016, 3016, 3016, 3017, 3017, 0, 3017, 3017, + 3017, 3017, 3018, 3018, 0, 3018, 3018, 3018, 3018, 3019, + 3019, 0, 3019, 3019, 3019, 3019, 3020, 3020, 0, 3020, + 3020, 3020, 3020, 3021, 3021, 0, 3021, 3021, 3021, 3021, + 3022, 3022, 0, 3022, 3022, 3022, 3022, 3023, 3023, 0, + 3023, 3023, 3023, 3023, 3024, 3024, 0, 3024, 3024, 3024, + + 3024, 3025, 3025, 0, 3025, 3025, 3025, 3025, 3026, 3026, + 0, 3026, 3026, 3026, 3026, 3027, 3027, 0, 3027, 3027, + 3027, 3027, 3028, 3028, 0, 3028, 3028, 3028, 3028, 3029, + 3029, 0, 3029, 3029, 3029, 3029, 3030, 3030, 0, 3030, + 3030, 3030, 3030, 3031, 3031, 0, 3031, 3031, 3031, 3031, + 3032, 3032, 0, 3032, 3032, 3032, 3032, 3033, 3033, 0, + 3033, 3033, 3033, 3033, 3034, 3034, 0, 3034, 3034, 3034, + 3034, 3035, 3035, 0, 3035, 3035, 3035, 3035, 3036, 3036, + 0, 3036, 3036, 3036, 3036, 3037, 3037, 0, 3037, 3037, + 3037, 3037, 3038, 3038, 0, 3038, 3038, 3038, 3038, 3039, + + 3039, 0, 3039, 3039, 3039, 3039, 3040, 3040, 0, 3040, + 3040, 3040, 3040, 3041, 3041, 0, 3041, 3041, 3041, 3041, + 3042, 3042, 0, 3042, 3042, 3042, 3042, 3043, 3043, 0, + 3043, 3043, 3043, 3043, 3044, 3044, 0, 3044, 3044, 3044, + 3044, 3045, 3045, 0, 3045, 3045, 3045, 3045, 3046, 3046, + 0, 3046, 3046, 3046, 3046, 3047, 3047, 0, 3047, 3047, + 3047, 3047, 3048, 3048, 0, 3048, 3048, 3048, 3048, 3049, + 3049, 0, 3049, 3049, 3049, 3049, 3050, 3050, 0, 3050, + 3050, 3050, 3050, 3051, 3051, 0, 3051, 3051, 3051, 3051, + 3052, 3052, 0, 3052, 3052, 3052, 3052, 3053, 3053, 0, + + 3053, 3053, 3053, 3053, 3054, 3054, 0, 3054, 3054, 3054, + 3054, 3055, 3055, 0, 3055, 3055, 3055, 3055, 3056, 3056, + 0, 3056, 3056, 3056, 3056, 3057, 3057, 0, 3057, 3057, + 3057, 3057, 3058, 3058, 0, 3058, 3058, 3058, 3058, 3059, + 3059, 0, 3059, 3059, 3059, 3059, 3060, 3060, 0, 3060, + 3060, 3060, 3060, 3061, 3061, 0, 3061, 3061, 3061, 3061, + 3062, 3062, 0, 3062, 3062, 3062, 3062, 3063, 3063, 0, + 3063, 3063, 3063, 3063, 3064, 3064, 0, 3064, 3064, 3064, + 3064, 3065, 3065, 0, 3065, 3065, 3065, 3065, 3066, 3066, + 0, 3066, 3066, 3066, 3066, 3067, 3067, 0, 3067, 3067, + + 3067, 3067, 3068, 3068, 0, 3068, 3068, 3068, 3068, 3069, + 3069, 0, 3069, 3069, 3069, 3069, 3070, 3070, 0, 3070, + 3070, 3070, 3070, 3071, 3071, 0, 3071, 3071, 3071, 3071, + 3072, 3072, 0, 3072, 3072, 3072, 3072, 3073, 3073, 0, + 3073, 3073, 3073, 3073, 3074, 3074, 0, 3074, 3074, 3074, + 3074, 3075, 3075, 0, 3075, 3075, 3075, 3075, 3076, 3076, + 0, 3076, 3076, 3076, 3076, 3077, 3077, 0, 3077, 3077, + 3077, 3077, 3078, 3078, 0, 3078, 3078, 3078, 3078, 3079, + 3079, 0, 3079, 3079, 3079, 3079, 3080, 3080, 0, 3080, + 3080, 3080, 3080, 3081, 3081, 0, 3081, 3081, 3081, 3081, + + 3082, 3082, 0, 3082, 3082, 3082, 3082, 3083, 3083, 0, + 3083, 3083, 3083, 3083, 3084, 3084, 0, 3084, 3084, 3084, + 3084, 3085, 3085, 0, 3085, 3085, 3085, 3085, 3086, 3086, + 0, 3086, 3086, 3086, 3086, 3087, 3087, 0, 3087, 3087, + 3087, 3087, 3088, 3088, 0, 3088, 3088, 3088, 3088, 3089, + 3089, 0, 3089, 3089, 3089, 3089, 3090, 3090, 0, 3090, + 3090, 3090, 3090, 3091, 3091, 0, 3091, 3091, 3091, 3091, + 3092, 3092, 0, 3092, 3092, 3092, 3092, 3093, 3093, 0, + 3093, 3093, 3093, 3093, 3094, 3094, 0, 3094, 3094, 3094, + 3094, 3095, 3095, 0, 3095, 3095, 3095, 3095, 3096, 3096, + + 0, 3096, 3096, 3096, 3096, 3097, 3097, 0, 3097, 3097, + 3097, 3097, 3098, 3098, 0, 3098, 3098, 3098, 3098, 3099, + 3099, 0, 3099, 3099, 3099, 3099, 3100, 3100, 0, 3100, + 3100, 3100, 3100, 3101, 3101, 0, 3101, 3101, 3101, 3101, + 3102, 3102, 0, 3102, 3102, 3102, 3102, 3103, 3103, 0, + 3103, 3103, 3103, 3103, 3104, 3104, 0, 3104, 3104, 3104, + 3104, 3105, 3105, 0, 3105, 3105, 3105, 3105, 3106, 3106, + 0, 3106, 3106, 3106, 3106, 3107, 3107, 0, 3107, 3107, + 3107, 3107, 3108, 3108, 0, 3108, 3108, 3108, 3108, 3109, + 3109, 0, 3109, 3109, 3109, 3109, 3110, 3110, 0, 3110, + + 3110, 3110, 3110, 3111, 3111, 0, 3111, 3111, 3111, 3111, + 3112, 3112, 0, 3112, 3112, 3112, 3112, 3113, 3113, 0, + 3113, 3113, 3113, 3113, 3114, 3114, 0, 3114, 3114, 3114, + 3114, 3115, 3115, 0, 3115, 3115, 3115, 3115, 3116, 3116, + 0, 3116, 3116, 3116, 3116, 3117, 3117, 0, 3117, 3117, + 3117, 3117, 3118, 3118, 0, 3118, 3118, 3118, 3118, 3119, + 3119, 0, 3119, 3119, 3119, 3119, 3120, 3120, 0, 3120, + 3120, 3120, 3120, 3121, 3121, 0, 3121, 3121, 3121, 3121, + 3122, 3122, 0, 3122, 3122, 3122, 3122, 3123, 3123, 0, + 3123, 3123, 3123, 3123, 3124, 3124, 0, 3124, 3124, 3124, + + 3124, 3125, 3125, 0, 3125, 3125, 3125, 3125, 3126, 3126, + 0, 3126, 3126, 3126, 3126, 3127, 3127, 0, 3127, 3127, + 3127, 3127, 3128, 3128, 0, 3128, 3128, 3128, 3128, 3129, + 3129, 0, 3129, 3129, 3129, 3129, 3130, 3130, 0, 3130, + 3130, 3130, 3130, 3131, 3131, 0, 3131, 3131, 3131, 3131, + 3132, 3132, 0, 3132, 3132, 3132, 3132, 3133, 3133, 0, + 3133, 3133, 3133, 3133, 3134, 3134, 0, 3134, 3134, 3134, + 3134, 3135, 3135, 0, 3135, 3135, 3135, 3135, 3136, 3136, + 0, 3136, 3136, 3136, 3136, 3137, 3137, 0, 3137, 3137, + 3137, 3137, 3138, 3138, 0, 3138, 3138, 3138, 3138, 3139, + + 3139, 0, 3139, 3139, 3139, 3139, 3140, 3140, 0, 3140, + 3140, 3140, 3140, 3141, 3141, 0, 3141, 3141, 3141, 3141, + 3142, 3142, 0, 3142, 3142, 3142, 3142, 3143, 3143, 0, + 3143, 3143, 3143, 3143, 3144, 3144, 0, 3144, 3144, 3144, + 3144, 3145, 3145, 0, 3145, 3145, 3145, 3145, 3146, 3146, + 0, 3146, 3146, 3146, 3146, 3147, 3147, 0, 3147, 3147, + 3147, 3147, 3148, 3148, 0, 3148, 3148, 3148, 3148, 3149, + 3149, 0, 3149, 3149, 3149, 3149, 3150, 3150, 0, 3150, + 3150, 3150, 3150, 3151, 3151, 0, 3151, 3151, 3151, 3151, + 3152, 3152, 0, 3152, 3152, 3152, 3152, 3153, 3153, 0, + + 3153, 3153, 3153, 3153, 3154, 3154, 0, 3154, 3154, 3154, + 3154, 3155, 3155, 0, 3155, 3155, 3155, 3155, 3156, 3156, + 0, 3156, 3156, 3156, 3156, 3157, 3157, 0, 3157, 3157, + 3157, 3157, 3158, 3158, 0, 3158, 3158, 3158, 3158, 3159, + 3159, 0, 3159, 3159, 3159, 3159, 3160, 3160, 0, 3160, + 3160, 3160, 3160, 3161, 3161, 0, 3161, 3161, 3161, 3161, + 3162, 3162, 0, 3162, 3162, 3162, 3162, 3163, 3163, 0, + 3163, 3163, 3163, 3163, 3164, 3164, 0, 3164, 3164, 3164, + 3164, 3165, 3165, 0, 3165, 3165, 3165, 3165, 3166, 3166, + 0, 3166, 3166, 3166, 3166, 3167, 3167, 0, 3167, 3167, + + 3167, 3167, 3168, 3168, 0, 3168, 3168, 3168, 3168, 3169, + 3169, 0, 3169, 3169, 3169, 3169, 3170, 3170, 0, 3170, + 3170, 3170, 3170, 3171, 3171, 0, 3171, 3171, 3171, 3171, + 3172, 3172, 0, 3172, 3172, 3172, 3172, 3173, 3173, 0, + 3173, 3173, 3173, 3173, 3174, 3174, 0, 3174, 3174, 3174, + 3174, 3175, 3175, 0, 3175, 3175, 3175, 3175, 3176, 3176, + 0, 3176, 3176, 3176, 3176, 3177, 3177, 0, 3177, 3177, + 3177, 3177, 3178, 3178, 0, 3178, 3178, 3178, 3178, 3179, + 3179, 0, 3179, 3179, 3179, 3179, 3180, 3180, 0, 3180, + 3180, 3180, 3180, 3181, 3181, 0, 3181, 3181, 3181, 3181, + + 3182, 3182, 0, 3182, 3182, 3182, 3182, 3183, 3183, 0, + 3183, 3183, 3183, 3183, 3184, 3184, 0, 3184, 3184, 3184, + 3184, 3185, 3185, 0, 3185, 3185, 3185, 3185, 3186, 3186, + 0, 3186, 3186, 3186, 3186, 3187, 3187, 0, 3187, 3187, + 3187, 3187, 3188, 3188, 0, 3188, 3188, 3188, 3188, 3189, + 3189, 0, 3189, 3189, 3189, 3189, 3190, 3190, 0, 3190, + 3190, 3190, 3190, 3191, 3191, 0, 3191, 3191, 3191, 3191, + 3192, 3192, 0, 3192, 3192, 3192, 3192, 3193, 3193, 0, + 3193, 3193, 3193, 3193, 3194, 3194, 0, 3194, 3194, 3194, + 3194, 3195, 3195, 0, 3195, 3195, 3195, 3195, 3196, 3196, + + 0, 3196, 3196, 3196, 3196, 3197, 3197, 0, 3197, 3197, + 3197, 3197, 3198, 3198, 0, 3198, 3198, 3198, 3198, 3199, + 3199, 0, 3199, 3199, 3199, 3199, 3200, 3200, 0, 3200, + 3200, 3200, 3200, 3201, 3201, 0, 3201, 3201, 3201, 3201, + 3202, 3202, 0, 3202, 3202, 3202, 3202, 3203, 3203, 0, + 3203, 3203, 3203, 3203, 3204, 3204, 0, 3204, 3204, 3204, + 3204, 3205, 3205, 0, 3205, 3205, 3205, 3205, 3206, 3206, + 0, 3206, 3206, 3206, 3206, 3207, 3207, 0, 3207, 3207, + 3207, 3207, 3208, 3208, 0, 3208, 3208, 3208, 3208, 3209, + 3209, 0, 3209, 3209, 3209, 3209, 3210, 3210, 0, 3210, + + 3210, 3210, 3210, 3211, 3211, 0, 3211, 3211, 3211, 3211, + 3212, 3212, 0, 3212, 3212, 3212, 3212, 3213, 3213, 0, + 3213, 3213, 3213, 3213, 3214, 3214, 0, 3214, 3214, 3214, + 3214, 3215, 3215, 0, 3215, 3215, 3215, 3215, 3216, 3216, + 0, 3216, 3216, 3216, 3216, 3217, 3217, 0, 3217, 3217, + 3217, 3217, 3218, 3218, 0, 3218, 3218, 3218, 3218, 3219, + 3219, 0, 3219, 3219, 3219, 3219, 3220, 3220, 0, 3220, + 3220, 3220, 3220, 3221, 3221, 0, 3221, 3221, 3221, 3221, + 3222, 3222, 0, 3222, 3222, 3222, 3222, 3223, 3223, 0, + 3223, 3223, 3223, 3223, 3224, 3224, 0, 3224, 3224, 3224, + + 3224, 3225, 3225, 0, 3225, 3225, 3225, 3225, 3226, 3226, + 0, 3226, 3226, 3226, 3226, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, 2847, + 2847, 2847, 2847, 2847, 2847, 2847 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int conf_flex_debug; +int conf_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 *conftext; +#line 1 "src/conf_lex.l" +#line 14 "src/conf_lex.l" + +#define YYDEBUG 1 + +/* + * Copyright (C) 1999-2002,2004-2006,2010-2013,2015,2016 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * 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 "aide.h" +#include +#include "gen_list.h" +#include "conf_yacc.h" +#include "list.h" +#include "symboltable.h" +#include "commandconf.h" + +void includehandler(void) ; +void conf_put_token(const char*); + +int firstnotempty(char* s); + +typedef struct conf_buffer_type { + char* buff; + char* pos; +} conf_buffer_type; + +list* l_symt=NULL; +list* conf_buffer=NULL; +int condition=0; +int varbol=0; + +long conf_lineno=1; +int newlinelastinconfig=0; + +#define MAX_INCLUDE_DEPTH 10 +YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; +int include_stack_ptr = 0; + +#define YY_INPUT(buf,result,max_size) \ + if( ((result=conf_input_wrapper(buf,max_size,confin)) == 0) \ + && ferror(confin) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); + +int var_in_conflval=0; + + +#line 5410 "src/conf_lex.c" + +#define INITIAL 0 +#define A 1 +#define EXPR 2 +#define DEFSTMT 3 +#define DEFSTMT2 4 +#define IFDEFSTMT 5 +#define INCLUDE 6 +#define EXPREQUHUNT 7 +#define VARSUB 8 +#define CONFVALHUNT 9 +#define IFHOSTSTMT 10 +#define E2FSATTRS 11 + +#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 conflex_destroy (void ); + +int confget_debug (void ); + +void confset_debug (int debug_flag ); + +YY_EXTRA_TYPE confget_extra (void ); + +void confset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *confget_in (void ); + +void confset_in (FILE * _in_str ); + +FILE *confget_out (void ); + +void confset_out (FILE * _out_str ); + +yy_size_t confget_leng (void ); + +char *confget_text (void ); + +int confget_lineno (void ); + +void confset_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 confwrap (void ); +#else +extern int confwrap (void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput (int c,char *buf_ptr ); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst 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( conftext, confleng, 1, confout )) {} } 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 = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( confin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( confin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, confin))==0 && ferror(confin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(confin); \ + } \ + }\ +\ + +#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 conflex (void); + +#define YY_DECL int conflex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after conftext and confleng + * 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 \ + if ( confleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (conftext[confleng - 1] == '\n'); \ + 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 ( ! confin ) + confin = stdin; + + if ( ! confout ) + confout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + confensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + conf_create_buffer(confin,YY_BUF_SIZE ); + } + + conf_load_buffer_state( ); + } + + { +#line 77 "src/conf_lex.l" + + +#line 5645 "src/conf_lex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of conftext. */ + *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_current_state += YY_AT_BOL(); +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 >= 2848 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 17416 ); + +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 79 "src/conf_lex.l" +{ + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 83 "src/conf_lex.l" +{ + + putbackvariable(conftext); + + error(230,"%li:Variable substitution\n",conf_lineno+1); + +} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 93 "src/conf_lex.l" +{ + conflval.s=strdup(conftext+1+firstnotempty(conftext)); + BEGIN(EXPR); + return (TEQURXRULE); +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 99 "src/conf_lex.l" +{ + conflval.s=strdup(conftext+firstnotempty(conftext)); + error(230,"%li:Selrule\n",conf_lineno); + BEGIN(EXPR); + return (TSELRXRULE ); +} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 106 "src/conf_lex.l" +{ + conflval.s=strdup(conftext+1+firstnotempty(conftext)); + error(230,"%li:Negrule\n",conf_lineno); + return (TNEGRXRULE ); +} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 112 "src/conf_lex.l" +{ + conflval.s=strdup(conftext+firstnotempty(conftext)); + error(230,"%li:Equrule\n",conf_lineno); + BEGIN(EXPREQUHUNT); + return (TSTRING); +} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 119 "src/conf_lex.l" +{ + BEGIN(EXPR); + return('='); +} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 124 "src/conf_lex.l" +{ + return (','); +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 128 "src/conf_lex.l" +{ + conflval.s=strdup(conftext+firstnotempty(conftext)); + return (TSTRING); +} + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 133 "src/conf_lex.l" +{ + conf_lineno++; + return (TNEWLINE); + BEGIN 0; +} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 139 "src/conf_lex.l" +{ + return ('+'); +} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 143 "src/conf_lex.l" +{ + return ('-'); +} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 147 "src/conf_lex.l" +{ + error(230," %s",conftext); + conflval.s=strdup(conftext); + BEGIN (DEFSTMT2); + return (TSTRING); +} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 154 "src/conf_lex.l" +{ + error(230," %s",conftext); + conflval.s=strdup(conftext); + return (TSTRING); +} + YY_BREAK +case 15: +/* rule 15 can match eol */ +YY_RULE_SETUP +#line 160 "src/conf_lex.l" +{ + error(230,"\n"); + conf_lineno++; + BEGIN 0; + return (TNEWLINE); +} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 167 "src/conf_lex.l" +{ + error(230,"%li:@@define",conf_lineno); + BEGIN DEFSTMT; + return (TDEFINE); +} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 173 "src/conf_lex.l" +{ + error(230,"%li:@@undef",conf_lineno); + BEGIN IFDEFSTMT; + return (TUNDEF); +} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 180 "src/conf_lex.l" +{ + error(230,"%li:@@ifndef",conf_lineno); + BEGIN IFDEFSTMT; + return (TIFNDEF); +} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 186 "src/conf_lex.l" +{ + error(230,"%li:@@ifdef",conf_lineno); + BEGIN IFDEFSTMT; + return (TIFDEF); +} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 192 "src/conf_lex.l" +{ + error(230,"%li:@@else\n",conf_lineno); + BEGIN 0; + return (TELSE); +} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 198 "src/conf_lex.l" +{ + error(230,"%li:@@endif\n",conf_lineno); + BEGIN 0; + return (TENDIF); +} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 204 "src/conf_lex.l" +{ + error(230,"%li:@@begin_db",conf_lineno); + BEGIN 0; + return (TBEGIN_DB); +} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 210 "src/conf_lex.l" +{ + error(230," %s\n",conftext); + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 217 "src/conf_lex.l" +{ + error(230,"%li:@@ifhost",conf_lineno); + BEGIN IFHOSTSTMT; + return (TIFHOST); +} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 223 "src/conf_lex.l" +{ + error(230,"%li:@@ifnhost",conf_lineno); + BEGIN IFHOSTSTMT; + return (TIFNHOST); +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 229 "src/conf_lex.l" +{ + error(230," %s\n",conftext); + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 236 "src/conf_lex.l" +{ + conf_put_token("\n@@db_spec"); + error(230,"%li:@@db_spec",conf_lineno); + return (TDBSPEC); +} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 242 "src/conf_lex.l" +{ + error(230,"%li:@@begin_config",conf_lineno); + BEGIN CONFVALHUNT; + return (TBEGIN_CONFIG); +} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 248 "src/conf_lex.l" +{ + return (TEND_CONFIG); +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 252 "src/conf_lex.l" +{ + BEGIN INCLUDE; +} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 256 "src/conf_lex.l" +{ + includehandler(); + BEGIN 0; + error(230,"%li:@@include\n",conf_lineno); + return (TNEWLINE); +} + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(A): +case YY_STATE_EOF(EXPR): +case YY_STATE_EOF(DEFSTMT): +case YY_STATE_EOF(DEFSTMT2): +case YY_STATE_EOF(IFDEFSTMT): +case YY_STATE_EOF(INCLUDE): +case YY_STATE_EOF(EXPREQUHUNT): +case YY_STATE_EOF(VARSUB): +case YY_STATE_EOF(CONFVALHUNT): +case YY_STATE_EOF(IFHOSTSTMT): +case YY_STATE_EOF(E2FSATTRS): +#line 263 "src/conf_lex.l" +{ + if (yy_hold_char=='\n'){ + newlinelastinconfig=1; + }else { + newlinelastinconfig=0; + } + if ( --include_stack_ptr < 0 ) + { + yyterminate(); + } + + else + { + + if (confin != stdin ) { + fclose(confin); + } + + conf_delete_buffer( YY_CURRENT_BUFFER ); + conf_switch_to_buffer( + include_stack[include_stack_ptr] ); + } +} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 288 "src/conf_lex.l" +{} + YY_BREAK +case 33: +/* rule 33 can match eol */ +YY_RULE_SETUP +#line 290 "src/conf_lex.l" +{ + conf_lineno++; + BEGIN 0; + return (TNEWLINE); + } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 296 "src/conf_lex.l" +{ + error(230,"%li:database =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE); +} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 302 "src/conf_lex.l" +{ + error(230,"%li:database_out =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE_OUT); +} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 308 "src/conf_lex.l" +{ + error(230,"%li:database_new =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE_NEW); +} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 314 "src/conf_lex.l" +{ + error(230,"%li:database_attrs =\n",conf_lineno); + BEGIN EXPR; + return (TDATABASE_ATTRS); +} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 320 "src/conf_lex.l" +{ + error(230,"%li:warn_dead_symlinks =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TWARNDEADSYMLINKS); +} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 326 "src/conf_lex.l" +{ + error(230,"%li:grouped =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TGROUPED); +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 332 "src/conf_lex.l" +{ + error(230,"%li:summarize_changes =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TSUMMARIZECHANGES); +} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 338 "src/conf_lex.l" +{ + error(230,"%li:acl_no_symlink_follow =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TACLNOSYMLINKFOLLOW); +} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 345 "src/conf_lex.l" +{ + error(230,"%li:verbose =\n",conf_lineno); + return (TVERBOSE); +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 350 "src/conf_lex.l" +{ + error(230,"%li:database_add_metadata =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASEADDMETADATA); +} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 356 "src/conf_lex.l" +{ + error(230,"%li:report_url =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORT_URL); +} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 362 "src/conf_lex.l" +{ + error(230,"%li:report_detailed_init =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTDETAILEDINIT); +} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 368 "src/conf_lex.l" +{ + error(230,"%li:report_base16 =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTBASE16); +} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 374 "src/conf_lex.l" +{ + error(230,"%li:report_quiet =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTQUIET); +} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 380 "src/conf_lex.l" +{ + error(230,"%li:report_ignore_e2fsattrs =\n",conf_lineno); + BEGIN E2FSATTRS; + return (TREPORTIGNOREE2FSATTRS); +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 386 "src/conf_lex.l" +{ + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 392 "src/conf_lex.l" +{ + error(230,"%li:gzip_dbout =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TGZIPDBOUT); +} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 398 "src/conf_lex.l" +{ + error(230,"%li:root_prefix =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TROOT_PREFIX); +} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 404 "src/conf_lex.l" +{ + error(230,"%li:recstop =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TRECSTOP); +} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 410 "src/conf_lex.l" +{ + error(230,"%li:config_version =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TCONFIG_VERSION); +} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 416 "src/conf_lex.l" +{ + BEGIN 0; + return (TTRUE); +} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 421 "src/conf_lex.l" +{ + BEGIN 0; + return (TFALSE); +} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 426 "src/conf_lex.l" +{ + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 433 "src/conf_lex.l" +{ + conflval.s=strdup(conftext); + return (TSTRING); +} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 439 "src/conf_lex.l" +{ return(conftext[0]); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 442 "src/conf_lex.l" +ECHO; + YY_BREAK +#line 6252 "src/conf_lex.c" + + 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 confin at a new source and called + * conflex(). 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 = confin; + 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 ( confwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * conftext, 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 conflex */ + +/* 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); + yy_size_t 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 = (yy_size_t) ((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 + { + yy_size_t 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 ) + { + yy_size_t 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. */ + confrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + 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; + confrestart(confin ); + } + + 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 ((int) ((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 *) confrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (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); + yy_current_state += YY_AT_BOL(); + + 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 >= 2848 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 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 >= 2848 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 2847); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) +{ + char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up conftext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#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 */ + yy_size_t offset = (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. */ + confrestart(confin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( confwrap( ) ) + return EOF; + + 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 conftext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + 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 confrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + confensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + conf_create_buffer(confin,YY_BUF_SIZE ); + } + + conf_init_buffer(YY_CURRENT_BUFFER,input_file ); + conf_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void conf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * confpop_buffer_state(); + * confpush_buffer_state(new_buffer); + */ + confensure_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; + conf_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (confwrap()) processing, but the only time this flag + * is looked at is after confwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void conf_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; + confin = 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 conf_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) confalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in conf_create_buffer()" ); + + b->yy_buf_size = (yy_size_t)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 *) confalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in conf_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + conf_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with conf_create_buffer() + * + */ + void conf_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 ) + conffree((void *) b->yy_ch_buf ); + + conffree((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a confrestart() or at EOF. + */ + static void conf_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + conf_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then conf_init_buffer was _probably_ + * called from confrestart() 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 conf_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 ) + conf_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 confpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + confensure_buffer_stack(); + + /* This block is copied from conf_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 conf_switch_to_buffer. */ + conf_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 confpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + conf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + conf_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 confensure_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**)confalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in confensure_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**)confrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in confensure_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 conf_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 0; + + b = (YY_BUFFER_STATE) confalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in conf_scan_buffer()" ); + + b->yy_buf_size = 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 = 0; + 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; + + conf_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to conflex() 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 + * conf_scan_bytes() instead. + */ +YY_BUFFER_STATE conf_scan_string (yyconst char * yystr ) +{ + + return conf_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to conflex() 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 conf_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) confalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in conf_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 = conf_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in conf_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 yy_fatal_error (yyconst char* msg ) +{ + (void) 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 conftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + conftext[confleng] = (yy_hold_char); \ + (yy_c_buf_p) = conftext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + confleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int confget_lineno (void) +{ + + return conflineno; +} + +/** Get the input stream. + * + */ +FILE *confget_in (void) +{ + return confin; +} + +/** Get the output stream. + * + */ +FILE *confget_out (void) +{ + return confout; +} + +/** Get the length of the current token. + * + */ +yy_size_t confget_leng (void) +{ + return confleng; +} + +/** Get the current token. + * + */ + +char *confget_text (void) +{ + return conftext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void confset_lineno (int _line_number ) +{ + + conflineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see conf_switch_to_buffer + */ +void confset_in (FILE * _in_str ) +{ + confin = _in_str ; +} + +void confset_out (FILE * _out_str ) +{ + confout = _out_str ; +} + +int confget_debug (void) +{ + return conf_flex_debug; +} + +void confset_debug (int _bdebug ) +{ + conf_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from conflex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + confin = stdin; + confout = stdout; +#else + confin = (FILE *) 0; + confout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * conflex_init() + */ + return 0; +} + +/* conflex_destroy is for both reentrant and non-reentrant scanners. */ +int conflex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + conf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + confpop_buffer_state(); + } + + /* Destroy the stack itself. */ + conffree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * conflex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst 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 (yyconst char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *confalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *confrealloc (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 (void *) realloc( (char *) ptr, size ); +} + +void conffree (void * ptr ) +{ + free( (char *) ptr ); /* see confrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 442 "src/conf_lex.l" + + + +int confwrap(void){ + return 1; +} + +void conf_put_token(const char* s){ + + int i=0; + + for(i=strlen(s)-1;i>=0;i--){ + unput(s[i]); + if(s[i]=='\n'){ + conf_lineno--; + } + } + +} + +int firstnotempty(char* s){ + + int i=0; + + if (s==NULL) { + return i; + } + + + while( s[i]==' ' || s[i]=='\t') { + i++; + } + + return i; + +} + +const char* aide_key_4=CONFHMACKEY_04; +const char* db_key_4=DBHMACKEY_04; + +void includehandler(void) { + /* got the include file name */ + if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) + { + error( 0, "Config includes nested too deeply\n" ); + exit( 1 ); + } + + if (strcmp(conftext,"-")==0) { + confin = stdin; + } else { + confin = fopen( conftext, "r" ); + } + if ( ! confin ) { + error(0,"Cannot open config file %s\n",conftext); + exit(IO_ERROR); + } else { + include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; + conf_switch_to_buffer(conf_create_buffer( confin, YY_BUF_SIZE ) ); + } + +} + + diff --git a/src/conf_lex.l b/src/conf_lex.l new file mode 100644 index 0000000..b08d7a7 --- /dev/null +++ b/src/conf_lex.l @@ -0,0 +1,503 @@ +SC [\\'"netbgr\ @#] +C [a-zA-Z0-9���������_\\=$%�@&/!\^\~;:.,\?\{\}\(\)\[\]\<\>\-\+\*\|\'\`] + +E [\ ]*"="[\ ]* + +L [a-zA-Z���������0-9_%] +D [0-9] + +PC \\[^\n] + +EX [" "\t]* + +%{ + +#define YYDEBUG 1 + +/* + * Copyright (C) 1999-2002,2004-2006,2010-2013,2015,2016 Rami Lehti, Pablo + * Virolainen, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * 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 "aide.h" +#include +#include "gen_list.h" +#include "conf_yacc.h" +#include "list.h" +#include "symboltable.h" +#include "commandconf.h" + +void includehandler(void) ; +void conf_put_token(const char*); + +int firstnotempty(char* s); + +typedef struct conf_buffer_type { + char* buff; + char* pos; +} conf_buffer_type; + +list* l_symt=NULL; +list* conf_buffer=NULL; +int condition=0; +int varbol=0; + +long conf_lineno=1; +int newlinelastinconfig=0; + +#define MAX_INCLUDE_DEPTH 10 +YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; +int include_stack_ptr = 0; + +#define YY_INPUT(buf,result,max_size) \ + if( ((result=conf_input_wrapper(buf,max_size,yyin)) == 0) \ + && ferror(yyin) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); + +int var_in_conflval=0; + +%} + +%Start A EXPR DEFSTMT DEFSTMT2 IFDEFSTMT INCLUDE EXPREQUHUNT VARSUB CONFVALHUNT IFHOSTSTMT E2FSATTRS + +%% + +"#"[^\n]* { + } + + +^[^\n]*"\@\@\{"({L}+)"}"[^\n]* { + + putbackvariable(conftext); + + error(230,"%li:Variable substitution\n",conf_lineno+1); + +} + + + +^[\ \t]*"=/"({C}|{PC})* { + conflval.s=strdup(conftext+1+firstnotempty(conftext)); + BEGIN(EXPR); + return (TEQURXRULE); +} + +^[\ \t]*"/"({C}|{PC})* { + conflval.s=strdup(conftext+firstnotempty(conftext)); + error(230,"%li:Selrule\n",conf_lineno); + BEGIN(EXPR); + return (TSELRXRULE ); +} + +^[\ \t]*"!/"({C}|{PC})* { + conflval.s=strdup(conftext+1+firstnotempty(conftext)); + error(230,"%li:Negrule\n",conf_lineno); + return (TNEGRXRULE ); +} + +^[\ \t]*({L})+ { + conflval.s=strdup(conftext+firstnotempty(conftext)); + error(230,"%li:Equrule\n",conf_lineno); + BEGIN(EXPREQUHUNT); + return (TSTRING); +} + +[\ \t]*"="[\ \t]* { + BEGIN(EXPR); + return('='); +} + +, { + return (','); +} + +[\ \t]*({L}|{D}|">")+ { + conflval.s=strdup(conftext+firstnotempty(conftext)); + return (TSTRING); +} + +[\ \t]*\n { + conf_lineno++; + return (TNEWLINE); + BEGIN 0; +} + +\+ { + return ('+'); +} + +\- { + return ('-'); +} + +({L})+ { + error(230," %s",conftext); + conflval.s=strdup(conftext); + BEGIN (DEFSTMT2); + return (TSTRING); +} + +({C})+ { + error(230," %s",conftext); + conflval.s=strdup(conftext); + return (TSTRING); +} + +[\ \t]*"\n" { + error(230,"\n"); + conf_lineno++; + BEGIN 0; + return (TNEWLINE); +} + +^[\ \t]*"\@\@define" { + error(230,"%li:@@define",conf_lineno); + BEGIN DEFSTMT; + return (TDEFINE); +} + +^[\ \t]*"\@\@undef" { + error(230,"%li:@@undef",conf_lineno); + BEGIN IFDEFSTMT; + return (TUNDEF); +} + + +^[\ \t]*"\@\@ifndef" { + error(230,"%li:@@ifndef",conf_lineno); + BEGIN IFDEFSTMT; + return (TIFNDEF); +} + +^[\ \t]*"\@\@ifdef" { + error(230,"%li:@@ifdef",conf_lineno); + BEGIN IFDEFSTMT; + return (TIFDEF); +} + +^[\ \t]*"\@\@else" { + error(230,"%li:@@else\n",conf_lineno); + BEGIN 0; + return (TELSE); +} + +^[\ \t]*"\@\@endif" { + error(230,"%li:@@endif\n",conf_lineno); + BEGIN 0; + return (TENDIF); +} + +^"\@\@begin_db" { + error(230,"%li:@@begin_db",conf_lineno); + BEGIN 0; + return (TBEGIN_DB); +} + +({L})+ { + error(230," %s\n",conftext); + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + +^[\ \t]*"\@\@ifhost" { + error(230,"%li:@@ifhost",conf_lineno); + BEGIN IFHOSTSTMT; + return (TIFHOST); +} + +^[\ \t]*"\@\@ifnhost" { + error(230,"%li:@@ifnhost",conf_lineno); + BEGIN IFHOSTSTMT; + return (TIFNHOST); +} + +({L}|"-")+ { + error(230," %s\n",conftext); + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + +^[\ \t]*"\@\@db_spec" { + conf_put_token("\n@@db_spec"); + error(230,"%li:@@db_spec",conf_lineno); + return (TDBSPEC); +} + +^[\ \t]*"\@\@begin_config" { + error(230,"%li:@@begin_config",conf_lineno); + BEGIN CONFVALHUNT; + return (TBEGIN_CONFIG); +} + +^[\ \t]*"\@\@end_config" { + return (TEND_CONFIG); +} + +^[\ \t]*"\@\@include" { + BEGIN INCLUDE; +} + +[^ \t\n]+ { + includehandler(); + BEGIN 0; + error(230,"%li:@@include\n",conf_lineno); + return (TNEWLINE); +} + +<> { + if (yy_hold_char=='\n'){ + newlinelastinconfig=1; + }else { + newlinelastinconfig=0; + } + if ( --include_stack_ptr < 0 ) + { + yyterminate(); + } + + else + { + + if (confin != stdin ) { + fclose(confin); + } + + conf_delete_buffer( YY_CURRENT_BUFFER ); + conf_switch_to_buffer( + include_stack[include_stack_ptr] ); + } +} + + +[\t\ ]+ {} + +"\n" { + conf_lineno++; + BEGIN 0; + return (TNEWLINE); + } + +^[\t\ ]*"database"{E} { + error(230,"%li:database =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE); +} + +^[\t\ ]*"database_out"{E} { + error(230,"%li:database_out =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE_OUT); +} + +^[\t\ ]*"database_new"{E} { + error(230,"%li:database_new =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASE_NEW); +} + +^[\t\ ]*"database_attrs"{E} { + error(230,"%li:database_attrs =\n",conf_lineno); + BEGIN EXPR; + return (TDATABASE_ATTRS); +} + +^[\t\ ]*"warn_dead_symlinks"{E} { + error(230,"%li:warn_dead_symlinks =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TWARNDEADSYMLINKS); +} + +^[\t\ ]*"grouped"{E} { + error(230,"%li:grouped =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TGROUPED); +} + +^[\t\ ]*"summarize_changes"{E} { + error(230,"%li:summarize_changes =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TSUMMARIZECHANGES); +} + +^[\t\ ]*"acl_no_symlink_follow"{E} { + error(230,"%li:acl_no_symlink_follow =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TACLNOSYMLINKFOLLOW); +} + + +^[\t\ ]*"verbose"{E} { + error(230,"%li:verbose =\n",conf_lineno); + return (TVERBOSE); +} + +^[\t\ ]*"database_add_metadata"{E} { + error(230,"%li:database_add_metadata =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TDATABASEADDMETADATA); +} + +^[\t\ ]*"report_url"{E} { + error(230,"%li:report_url =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORT_URL); +} + +^[\t\ ]*"report_detailed_init"{E} { + error(230,"%li:report_detailed_init =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTDETAILEDINIT); +} + +^[\t\ ]*"report_base16"{E} { + error(230,"%li:report_base16 =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTBASE16); +} + +^[\t\ ]*"report_quiet"{E} { + error(230,"%li:report_quiet =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TREPORTQUIET); +} + +^[\t\ ]*"report_ignore_e2fsattrs"{E} { + error(230,"%li:report_ignore_e2fsattrs =\n",conf_lineno); + BEGIN E2FSATTRS; + return (TREPORTIGNOREE2FSATTRS); +} + +([A-Za-z]+|"0") { + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + +^[\t\ ]*"gzip_dbout"{E} { + error(230,"%li:gzip_dbout =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TGZIPDBOUT); +} + +^[\t\ ]*"root_prefix"{E} { + error(230,"%li:root_prefix =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TROOT_PREFIX); +} + +^[\t\ ]*"recstop"{E} { + error(230,"%li:recstop =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TRECSTOP); +} + +^[\ \t]*"config_version"{E} { + error(230,"%li:config_version =\n",conf_lineno); + BEGIN CONFVALHUNT; + return (TCONFIG_VERSION); +} + +("yes"|"true") { + BEGIN 0; + return (TTRUE); +} + +("no"|"false") { + BEGIN 0; + return (TFALSE); +} + +({C})+ { + conflval.s=strdup(conftext); + BEGIN 0; + return (TSTRING); +} + + +({L})+ { + conflval.s=strdup(conftext); + return (TSTRING); +} + + +[^\n] { return(conftext[0]); } + + +%% + +int confwrap(void){ + return 1; +} + +void conf_put_token(const char* s){ + + int i=0; + + for(i=strlen(s)-1;i>=0;i--){ + unput(s[i]); + if(s[i]=='\n'){ + conf_lineno--; + } + } + +} + +int firstnotempty(char* s){ + + int i=0; + + if (s==NULL) { + return i; + } + + + while( s[i]==' ' || s[i]=='\t') { + i++; + } + + return i; + +} + +const char* aide_key_4=CONFHMACKEY_04; +const char* db_key_4=DBHMACKEY_04; + +void includehandler(void) { + /* got the include file name */ + if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) + { + error( 0, "Config includes nested too deeply\n" ); + exit( 1 ); + } + + if (strcmp(conftext,"-")==0) { + confin = stdin; + } else { + confin = fopen( conftext, "r" ); + } + if ( ! confin ) { + error(0,"Cannot open config file %s\n",conftext); + exit(IO_ERROR); + } else { + include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; + conf_switch_to_buffer(conf_create_buffer( confin, YY_BUF_SIZE ) ); + } + +} + diff --git a/src/conf_yacc.c b/src/conf_yacc.c new file mode 100644 index 0000000..22e4226 --- /dev/null +++ b/src/conf_yacc.c @@ -0,0 +1,2465 @@ +/* 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 + + +/* Substitute the variable and function names. */ +#define yyparse confparse +#define yylex conflex +#define yyerror conferror +#define yydebug confdebug +#define yynerrs confnerrs + +#define yylval conflval +#define yychar confchar + +/* Copy the first part of user declarations. */ +#line 1 "src/conf_yacc.y" /* yacc.c:339 */ + + +/* + * Copyright (C) 1999-2006,2010-2013,2015,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * 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 "aide.h" +#include +#include +#include +#include +#include +#include "list.h" +#include "gen_list.h" +#include "db.h" +#include "db_config.h" +#include "symboltable.h" +#include "util.h" +#include "commandconf.h" + +DB_ATTR_TYPE retval=0; +extern int conflex(); +void conferror(const char*); + +extern char *conftext; +extern long conf_lineno; + + + +#line 119 "src/conf_yacc.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 "conf_yacc.h". */ +#ifndef YY_CONF_SRC_CONF_YACC_H_INCLUDED +# define YY_CONF_SRC_CONF_YACC_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int confdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + TDEFINE = 258, + TUNDEF = 259, + TIFDEF = 260, + TIFNDEF = 261, + TIFNHOST = 262, + TIFHOST = 263, + TELSE = 264, + TENDIF = 265, + TINCLUDE = 266, + TBEGIN_CONFIG = 267, + TEND_CONFIG = 268, + TBEGIN_DB = 269, + TEND_DB = 270, + TEND_DBNOMD = 271, + TID = 272, + TSTRING = 273, + TACLNOSYMLINKFOLLOW = 274, + TWARNDEADSYMLINKS = 275, + TGROUPED = 276, + TSUMMARIZECHANGES = 277, + TNEWLINE = 278, + TVERBOSE = 279, + TDATABASEADDMETADATA = 280, + TREPORTDETAILEDINIT = 281, + TREPORTBASE16 = 282, + TREPORTQUIET = 283, + TREPORTIGNOREE2FSATTRS = 284, + TCONFIG_FILE = 285, + TDATABASE = 286, + TDATABASE_OUT = 287, + TDATABASE_NEW = 288, + TDATABASE_ATTRS = 289, + TREPORT_URL = 290, + TGZIPDBOUT = 291, + TROOT_PREFIX = 292, + TUMASK = 293, + TTRUE = 294, + TFALSE = 295, + TRECSTOP = 296, + TCONFIG_VERSION = 297, + TSELRXRULE = 298, + TEQURXRULE = 299, + TNEGRXRULE = 300, + TRIGHTS = 301, + TUSER = 302, + TGROUP = 303, + TINODE = 304, + TLINKCOUNT = 305, + TFTYPE = 306, + TSIZE = 307, + TGROWINGSIZE = 308, + TATIME = 309, + TCTIME = 310, + TMTIME = 311, + TACL = 312, + TXATTRS = 313, + TSELINUX = 314, + TE2FSATTRS = 315, + TTIGER = 316, + TSHA1 = 317, + TRMD160 = 318, + TMD2 = 319, + TMD4 = 320, + TMD5 = 321, + TSHA256 = 322, + TSHA512 = 323, + TWHIRLPOOL = 324, + TL = 325, + TR = 326, + TGZIPHEADER = 327, + TDBSPEC = 328, + TUNKNOWN = 329, + TNAME = 330, + TERROR = 331, + TEOF = 332 + }; +#endif +/* Tokens. */ +#define TDEFINE 258 +#define TUNDEF 259 +#define TIFDEF 260 +#define TIFNDEF 261 +#define TIFNHOST 262 +#define TIFHOST 263 +#define TELSE 264 +#define TENDIF 265 +#define TINCLUDE 266 +#define TBEGIN_CONFIG 267 +#define TEND_CONFIG 268 +#define TBEGIN_DB 269 +#define TEND_DB 270 +#define TEND_DBNOMD 271 +#define TID 272 +#define TSTRING 273 +#define TACLNOSYMLINKFOLLOW 274 +#define TWARNDEADSYMLINKS 275 +#define TGROUPED 276 +#define TSUMMARIZECHANGES 277 +#define TNEWLINE 278 +#define TVERBOSE 279 +#define TDATABASEADDMETADATA 280 +#define TREPORTDETAILEDINIT 281 +#define TREPORTBASE16 282 +#define TREPORTQUIET 283 +#define TREPORTIGNOREE2FSATTRS 284 +#define TCONFIG_FILE 285 +#define TDATABASE 286 +#define TDATABASE_OUT 287 +#define TDATABASE_NEW 288 +#define TDATABASE_ATTRS 289 +#define TREPORT_URL 290 +#define TGZIPDBOUT 291 +#define TROOT_PREFIX 292 +#define TUMASK 293 +#define TTRUE 294 +#define TFALSE 295 +#define TRECSTOP 296 +#define TCONFIG_VERSION 297 +#define TSELRXRULE 298 +#define TEQURXRULE 299 +#define TNEGRXRULE 300 +#define TRIGHTS 301 +#define TUSER 302 +#define TGROUP 303 +#define TINODE 304 +#define TLINKCOUNT 305 +#define TFTYPE 306 +#define TSIZE 307 +#define TGROWINGSIZE 308 +#define TATIME 309 +#define TCTIME 310 +#define TMTIME 311 +#define TACL 312 +#define TXATTRS 313 +#define TSELINUX 314 +#define TE2FSATTRS 315 +#define TTIGER 316 +#define TSHA1 317 +#define TRMD160 318 +#define TMD2 319 +#define TMD4 320 +#define TMD5 321 +#define TSHA256 322 +#define TSHA512 323 +#define TWHIRLPOOL 324 +#define TL 325 +#define TR 326 +#define TGZIPHEADER 327 +#define TDBSPEC 328 +#define TUNKNOWN 329 +#define TNAME 330 +#define TERROR 331 +#define TEOF 332 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 45 "src/conf_yacc.y" /* yacc.c:355 */ + + char* s; + DB_ATTR_TYPE i; + RESTRICTION_TYPE r; + +#line 319 "src/conf_yacc.c" /* yacc.c:355 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE conflval; + +int confparse (void); + +#endif /* !YY_CONF_SRC_CONF_YACC_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 336 "src/conf_yacc.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 315 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 82 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 45 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 123 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 174 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 332 + +#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, 79, 81, 80, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 19, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78 +}; + +#if YYDEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 157, 157, 157, 159, 159, 159, 159, 159, 160, + 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, + 161, 162, 162, 162, 162, 162, 162, 163, 163, 163, + 163, 164, 164, 164, 164, 165, 169, 170, 174, 178, + 181, 186, 189, 192, 195, 198, 201, 204, 205, 210, + 211, 221, 222, 223, 225, 226, 227, 237, 237, 238, + 238, 239, 239, 239, 240, 240, 241, 241, 241, 242, + 242, 242, 243, 243, 245, 245, 245, 246, 246, 246, + 247, 249, 251, 253, 253, 260, 260, 267, 267, 274, + 274, 281, 282, 284, 286, 288, 290, 292, 294, 296, + 305, 312, 316, 324, 332, 336, 340, 344, 348, 352, + 356, 364, 368, 372, 376, 380, 384, 386, 390, 394, + 398, 405, 411, 416 +}; +#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", "TDEFINE", "TUNDEF", "TIFDEF", "TIFNDEF", + "TIFNHOST", "TIFHOST", "TELSE", "TENDIF", "TINCLUDE", "TBEGIN_CONFIG", + "TEND_CONFIG", "TBEGIN_DB", "TEND_DB", "TEND_DBNOMD", "TID", "TSTRING", + "'='", "TACLNOSYMLINKFOLLOW", "TWARNDEADSYMLINKS", "TGROUPED", + "TSUMMARIZECHANGES", "TNEWLINE", "TVERBOSE", "TDATABASEADDMETADATA", + "TREPORTDETAILEDINIT", "TREPORTBASE16", "TREPORTQUIET", + "TREPORTIGNOREE2FSATTRS", "TCONFIG_FILE", "TDATABASE", "TDATABASE_OUT", + "TDATABASE_NEW", "TDATABASE_ATTRS", "TREPORT_URL", "TGZIPDBOUT", + "TROOT_PREFIX", "TUMASK", "TTRUE", "TFALSE", "TRECSTOP", + "TCONFIG_VERSION", "TSELRXRULE", "TEQURXRULE", "TNEGRXRULE", "TRIGHTS", + "TUSER", "TGROUP", "TINODE", "TLINKCOUNT", "TFTYPE", "TSIZE", + "TGROWINGSIZE", "TATIME", "TCTIME", "TMTIME", "TACL", "TXATTRS", + "TSELINUX", "TE2FSATTRS", "TTIGER", "TSHA1", "TRMD160", "TMD2", "TMD4", + "TMD5", "TSHA256", "TSHA512", "TWHIRLPOOL", "TL", "TR", "TGZIPHEADER", + "TDBSPEC", "TUNKNOWN", "TNAME", "TERROR", "TEOF", "'+'", "'-'", "','", + "$accept", "lines", "line", "rule", "equrule", "negrule", "newlineoreof", + "restriction", "expr", "primary", "other", "hash", "definestmt", + "undefstmt", "ifdefstmt", "$@1", "ifndefstmt", "$@2", "ifhoststmt", + "$@3", "ifnhoststmt", "$@4", "ifstmtlist", "groupdef", "db_in", "db_out", + "db_new", "verbose", "report", "db_attrs", "beginconfigstmt", + "endconfigstmt", "acl_no_symlink_follow", "warn_dead_symlinks", + "database_add_metadata", "report_detailed_init", + "report_ignore_e2fsattrs", "report_base16", "report_quiet", "grouped", + "root_prefix", "summarize_changes", "gzipdbout", "recursion_stopper", + "config_version", 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, 61, + 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, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 43, + 45, 44 +}; +# endif + +#define YYPACT_NINF -135 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-135))) + +#define YYTABLE_NINF -57 + +#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[] = +{ + -135, 5, -135, -135, -11, 64, 68, 77, 79, 84, + 94, -135, -135, -135, 111, -19, 31, 40, 44, -135, + 117, 48, 51, 67, 69, 118, 120, 132, 148, 196, + 149, 74, 150, 151, 153, 243, 243, 28, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, 154, -135, -135, -135, -135, -135, -135, 196, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, 37, -135, -135, -135, + -135, -135, -135, -135, -135, -135, 20, 6, 80, 6, + 80, -135, -135, -135, -135, 12, -135, -135, -135, -135, + -135, 37, 196, 196, 155, 80, -135, 80, -135, -135, + 119, -135, -135, -135, -135, -135, -135, 93, -135, -135, + -135, -135, 195, -135 +}; + + /* 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[] = +{ + 3, 0, 1, 40, 0, 0, 0, 0, 0, 0, + 0, 101, 38, 39, 0, 0, 0, 0, 0, 36, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 37, 35, + 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 18, 22, 17, 33, 34, 32, + 29, 21, 19, 27, 25, 26, 30, 24, 31, 23, + 28, 20, 0, 82, 83, 85, 89, 87, 100, 0, + 102, 103, 104, 105, 115, 117, 118, 119, 97, 106, + 107, 108, 109, 111, 112, 113, 114, 110, 94, 95, + 96, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 68, 69, 99, 53, 55, 54, + 98, 120, 121, 116, 122, 123, 50, 0, 0, 0, + 0, 50, 47, 48, 43, 0, 81, 3, 3, 3, + 3, 93, 0, 0, 0, 0, 41, 0, 42, 46, + 0, 84, 86, 90, 88, 51, 52, 49, 44, 45, + 3, 91, 0, 92 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -135, 0, -135, -135, -135, -135, -44, -33, -34, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -134, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 160, 40, 41, 42, 43, 144, 137, 126, 127, + 128, 129, 44, 45, 46, 147, 47, 148, 48, 150, + 49, 149, 161, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 1, 138, 140, 139, 145, 2, 3, 72, 4, 5, + 6, 7, 8, 9, 162, 163, 164, 10, 11, 12, + 13, 80, 81, 14, 101, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 142, 26, 27, 28, + 29, 30, 31, 32, -56, 151, 141, 33, 34, 35, + 36, 37, 142, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 82, 83, 120, 121, 122, 123, 124, 125, 38, + 84, 85, 73, 39, 86, 87, 74, 154, 89, 90, + 143, 91, 92, 154, 156, 75, 158, 76, -56, -56, + -56, 159, 77, 155, 142, 157, 143, 93, 94, 95, + 96, 168, 78, 169, 131, 132, 152, 153, 165, 166, + 3, 167, 4, 5, 6, 7, 8, 9, 170, 171, + 79, 10, 11, 12, 13, 88, 97, 14, 98, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 99, 26, 27, 28, 29, 30, 31, 32, 143, 152, + 153, 33, 34, 35, 36, 37, 100, 130, 133, 134, + 172, 135, 146, 141, 154, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 38, 0, 0, 3, 39, 4, 5, + 6, 7, 8, 9, 0, 173, 0, 10, 11, 12, + 13, 0, 0, 14, 101, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 0, 26, 27, 28, + 29, 30, 31, 32, 0, 0, 0, 33, 34, 35, + 36, 37, 0, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 136, 0, 120, 121, 122, 123, 124, 125, 38, + 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 0, 0, + 120, 121, 122, 123, 124, 125 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 35, 36, 36, 37, 0, 1, 18, 3, 4, + 5, 6, 7, 8, 148, 149, 150, 12, 13, 14, + 15, 40, 41, 18, 18, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 24, 32, 33, 34, + 35, 36, 37, 38, 24, 79, 18, 42, 43, 44, + 45, 46, 24, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 40, 41, 67, 68, 69, 70, 71, 72, 74, + 40, 41, 18, 78, 40, 41, 18, 81, 40, 41, + 78, 40, 41, 81, 138, 18, 140, 18, 78, 79, + 80, 145, 18, 137, 24, 139, 78, 40, 41, 40, + 41, 155, 18, 157, 40, 41, 79, 80, 152, 153, + 1, 154, 3, 4, 5, 6, 7, 8, 9, 10, + 19, 12, 13, 14, 15, 18, 18, 18, 18, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 18, 32, 33, 34, 35, 36, 37, 38, 78, 79, + 80, 42, 43, 44, 45, 46, 18, 18, 18, 18, + 170, 18, 18, 18, 81, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 74, -1, -1, 1, 78, 3, 4, + 5, 6, 7, 8, -1, 10, -1, 12, 13, 14, + 15, -1, -1, 18, 18, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, -1, 32, 33, 34, + 35, 36, 37, 38, -1, -1, -1, 42, 43, 44, + 45, 46, -1, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 18, -1, 67, 68, 69, 70, 71, 72, 74, + -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, + 67, 68, 69, 70, 71, 72 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 83, 0, 1, 3, 4, 5, 6, 7, 8, + 12, 13, 14, 15, 18, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, + 36, 37, 38, 42, 43, 44, 45, 46, 74, 78, + 84, 85, 86, 87, 94, 95, 96, 98, 100, 102, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 18, 18, 18, 18, 18, 18, 18, 19, + 40, 41, 40, 41, 40, 41, 40, 41, 18, 40, + 41, 40, 41, 40, 41, 40, 41, 18, 18, 18, + 18, 18, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 67, 68, 69, 70, 71, 72, 90, 91, 92, 93, + 18, 40, 41, 18, 18, 18, 18, 89, 90, 89, + 90, 18, 24, 78, 88, 89, 18, 97, 99, 103, + 101, 90, 79, 80, 81, 90, 88, 90, 88, 88, + 83, 104, 104, 104, 104, 90, 90, 89, 88, 88, + 9, 10, 83, 10 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 82, 83, 83, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 85, 86, 87, 85, 86, 87, 88, 88, 89, + 89, 90, 90, 90, 91, 91, 91, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, + 93, 94, 95, 97, 96, 99, 98, 101, 100, 103, + 102, 104, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 114, 115, 115, 116, 116, 117, 117, + 118, 119, 119, 120, 120, 121, 122, 121, 123, 123, + 124, 124, 125, 126 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 3, 2, 4, 4, 3, 1, 1, 3, + 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 2, 0, 4, 0, 4, 0, 4, 0, + 4, 2, 4, 3, 2, 2, 2, 2, 2, 2, + 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2 +}; + + +#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 35: +#line 165 "src/conf_yacc.y" /* yacc.c:1646 */ + { + newlinelastinconfig=1; + YYACCEPT; + } +#line 1600 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 37: +#line 170 "src/conf_yacc.y" /* yacc.c:1646 */ + { + error(220,"Got @@dbspec.Stopping\n"); + YYACCEPT; + } +#line 1609 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 38: +#line 174 "src/conf_yacc.y" /* yacc.c:1646 */ + { + error(220,"Got @@begin_db. Stopping\n"); + YYACCEPT; + } +#line 1618 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 39: +#line 178 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conferror("Error while reading configuration"); + } +#line 1626 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 40: +#line 181 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conferror("Error while reading configuration"); + YYABORT; + } +#line 1635 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 41: +#line 187 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-2].s)); conf->selrxlst=append_rxlist((yyvsp[-2].s),(yyvsp[-1].i),conf->selrxlst, RESTRICTION_NULL); } +#line 1641 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 42: +#line 190 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-2].s)); conf->equrxlst=append_rxlist((yyvsp[-2].s),(yyvsp[-1].i),conf->equrxlst, RESTRICTION_NULL); } +#line 1647 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 43: +#line 193 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-1].s)); conf->negrxlst=append_rxlist((yyvsp[-1].s),0,conf->negrxlst, RESTRICTION_NULL); } +#line 1653 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 44: +#line 196 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-3].s)); conf->selrxlst=append_rxlist((yyvsp[-3].s),(yyvsp[-1].i),conf->selrxlst, (yyvsp[-2].r)); } +#line 1659 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 45: +#line 199 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-3].s)); conf->equrxlst=append_rxlist((yyvsp[-3].s),(yyvsp[-1].i),conf->equrxlst, (yyvsp[-2].r)); } +#line 1665 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 46: +#line 202 "src/conf_yacc.y" /* yacc.c:1646 */ + { decode_string((yyvsp[-2].s)); conf->negrxlst=append_rxlist((yyvsp[-2].s),0,conf->negrxlst, (yyvsp[-1].r)); } +#line 1671 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 48: +#line 205 "src/conf_yacc.y" /* yacc.c:1646 */ + { + newlinelastinconfig=0; + YYACCEPT; + } +#line 1680 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 49: +#line 210 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.r) =(yyvsp[-2].r) | (yyvsp[0].r) ; } +#line 1686 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 50: +#line 211 "src/conf_yacc.y" /* yacc.c:1646 */ + { + if((retval=get_restrictionval((yyvsp[0].s))) != RESTRICTION_NULL) { + (yyval.r)=retval; + } else { + conf_lineno++; + conferror("Error in restriction"); + YYABORT; + } + } +#line 1700 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 51: +#line 221 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[-2].i) | (yyvsp[0].i) ; } +#line 1706 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 52: +#line 222 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[-2].i) & (~(yyvsp[0].i) ); } +#line 1712 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 53: +#line 223 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1718 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 54: +#line 225 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ; } +#line 1724 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 55: +#line 226 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ; } +#line 1730 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 56: +#line 227 "src/conf_yacc.y" /* yacc.c:1646 */ + { if((retval=get_groupval((yyvsp[0].s))) != DB_ATTR_UNDEF) { + (yyval.i)=retval; + } + else { + conf_lineno++; // Hack + conferror("Error in expression"); + YYABORT; + } + } +#line 1744 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 57: +#line 237 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1750 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 58: +#line 237 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1756 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 59: +#line 238 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1762 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 60: +#line 238 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1768 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 61: +#line 239 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1774 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 62: +#line 239 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1780 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 63: +#line 239 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1786 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 64: +#line 240 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1792 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 65: +#line 240 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1798 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 66: +#line 241 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1804 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 67: +#line 241 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1810 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 68: +#line 241 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) = (yyvsp[0].i);} +#line 1816 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 69: +#line 242 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) = (yyvsp[0].i);} +#line 1822 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 70: +#line 242 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1828 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 71: +#line 242 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1834 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 72: +#line 243 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1840 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 73: +#line 243 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1846 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 74: +#line 245 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1852 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 75: +#line 245 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1858 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 76: +#line 245 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1864 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 77: +#line 246 "src/conf_yacc.y" /* yacc.c:1646 */ + {(yyval.i) =(yyvsp[0].i) ;} +#line 1870 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 78: +#line 246 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1876 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 79: +#line 246 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1882 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 80: +#line 247 "src/conf_yacc.y" /* yacc.c:1646 */ + { (yyval.i) =(yyvsp[0].i) ;} +#line 1888 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 81: +#line 249 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_define((yyvsp[-1].s),(yyvsp[0].s)); } +#line 1894 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 82: +#line 251 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_undefine((yyvsp[0].s)); } +#line 1900 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 83: +#line 253 "src/conf_yacc.y" /* yacc.c:1646 */ + { + if(do_ifxdef(1,(yyvsp[0].s))==-1){ + error(0,"ifdef error\n"); + YYABORT; + }; + } +#line 1911 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 85: +#line 260 "src/conf_yacc.y" /* yacc.c:1646 */ + { + if(do_ifxdef(0,(yyvsp[0].s))==-1){ + error(0,"ifndef error\n"); + YYABORT; + }; + } +#line 1922 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 86: +#line 265 "src/conf_yacc.y" /* yacc.c:1646 */ + { error(220,"Ifndef statement ended\n");} +#line 1928 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 87: +#line 267 "src/conf_yacc.y" /* yacc.c:1646 */ + { + if(do_ifxhost(1,(yyvsp[0].s))==-1){ + error(0,"ifhost error\n"); + YYABORT; + }; + } +#line 1939 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 89: +#line 274 "src/conf_yacc.y" /* yacc.c:1646 */ + { + if(do_ifxhost(0,(yyvsp[0].s))==-1){ + error(0,"ifnhost error\n"); + YYABORT; + }; + } +#line 1950 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 91: +#line 281 "src/conf_yacc.y" /* yacc.c:1646 */ + { error(220,"Endif stmt matched\n");} +#line 1956 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 92: +#line 282 "src/conf_yacc.y" /* yacc.c:1646 */ + {error(220,"Endifelse stmt matched\n");} +#line 1962 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 93: +#line 284 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_groupdef((yyvsp[-2].s),(yyvsp[0].i)); } +#line 1968 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 94: +#line 286 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_dbdef(DB_OLD,(yyvsp[0].s)); } +#line 1974 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 95: +#line 288 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_dbdef(DB_WRITE,(yyvsp[0].s)); } +#line 1980 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 96: +#line 290 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_dbdef(DB_NEW,(yyvsp[0].s)); } +#line 1986 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 97: +#line 292 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_verbdef((yyvsp[0].s)); } +#line 1992 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 98: +#line 294 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_repurldef((yyvsp[0].s)); } +#line 1998 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 99: +#line 296 "src/conf_yacc.y" /* yacc.c:1646 */ + { + DB_ATTR_TYPE attr; + if((attr = (yyvsp[0].i)&(~DB_HASHES))){ + error(0, "%li: invalid attribute(s) in database_attrs: %llx\n", conf_lineno-1, attr); + YYABORT; + } + conf->db_attrs=(yyvsp[0].i); +} +#line 2011 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 100: +#line 305 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_MHASH + conf->do_configmd=1; + conf->old_confmdstr=strdup((yyvsp[0].s)); +#endif +} +#line 2022 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 101: +#line 312 "src/conf_yacc.y" /* yacc.c:1646 */ + { + YYACCEPT; +} +#line 2030 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 102: +#line 316 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_ACL + conf->no_acl_on_symlinks=1; +#else + error(0,"ACL-support not compiled in.\n"); +#endif +} +#line 2042 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 103: +#line 324 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_ACL + conf->no_acl_on_symlinks=0; +#else + error(0,"ACL-support not compiled in.\n"); +#endif +} +#line 2054 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 104: +#line 332 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->warn_dead_symlinks=1; +} +#line 2062 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 105: +#line 336 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->warn_dead_symlinks=0; +} +#line 2070 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 106: +#line 340 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->database_add_metadata=1; +} +#line 2078 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 107: +#line 344 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->database_add_metadata=0; +} +#line 2086 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 108: +#line 348 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_detailed_init=1; +} +#line 2094 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 109: +#line 352 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_detailed_init=0; +} +#line 2102 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 110: +#line 356 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_E2FSATTRS + do_report_ignore_e2fsattrs((yyvsp[0].s)); +#else + error(0,"e2fsattrs-support not compiled in.\n"); +#endif +} +#line 2114 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 111: +#line 364 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_base16=1; +} +#line 2122 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 112: +#line 368 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_base16=0; +} +#line 2130 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 113: +#line 372 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_quiet=1; +} +#line 2138 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 114: +#line 376 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->report_quiet=0; +} +#line 2146 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 115: +#line 380 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->grouped=1; +} +#line 2154 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 116: +#line 384 "src/conf_yacc.y" /* yacc.c:1646 */ + { do_rootprefix((yyvsp[0].s)); } +#line 2160 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 117: +#line 386 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->grouped=0; +} +#line 2168 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 118: +#line 390 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->summarize_changes=1; +} +#line 2176 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 119: +#line 394 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->summarize_changes=0; +} +#line 2184 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 120: +#line 398 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_ZLIB +conf->gzip_dbout=1; +#else + error(0,"Gzip-support not compiled in.\n"); +#endif +} +#line 2196 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 121: +#line 405 "src/conf_yacc.y" /* yacc.c:1646 */ + { +#ifdef WITH_ZLIB +conf->gzip_dbout=0; +#endif +} +#line 2206 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 122: +#line 411 "src/conf_yacc.y" /* yacc.c:1646 */ + { + /* FIXME implement me */ + +} +#line 2215 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + case 123: +#line 416 "src/conf_yacc.y" /* yacc.c:1646 */ + { + conf->config_version=strdup((yyvsp[0].s)); +} +#line 2223 "src/conf_yacc.c" /* yacc.c:1646 */ + break; + + +#line 2227 "src/conf_yacc.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; +} +#line 420 "src/conf_yacc.y" /* yacc.c:1906 */ + + + +void conferror(const char *msg){ + error(0,"%li:%s:%s\n",conf_lineno-1,msg,conftext); + +} + +const char* aide_key_1=CONFHMACKEY_01; +const char* db_key_1=DBHMACKEY_01; + diff --git a/src/conf_yacc.h b/src/conf_yacc.h new file mode 100644 index 0000000..4133568 --- /dev/null +++ b/src/conf_yacc.h @@ -0,0 +1,226 @@ +/* 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_CONF_SRC_CONF_YACC_H_INCLUDED +# define YY_CONF_SRC_CONF_YACC_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int confdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + TDEFINE = 258, + TUNDEF = 259, + TIFDEF = 260, + TIFNDEF = 261, + TIFNHOST = 262, + TIFHOST = 263, + TELSE = 264, + TENDIF = 265, + TINCLUDE = 266, + TBEGIN_CONFIG = 267, + TEND_CONFIG = 268, + TBEGIN_DB = 269, + TEND_DB = 270, + TEND_DBNOMD = 271, + TID = 272, + TSTRING = 273, + TACLNOSYMLINKFOLLOW = 274, + TWARNDEADSYMLINKS = 275, + TGROUPED = 276, + TSUMMARIZECHANGES = 277, + TNEWLINE = 278, + TVERBOSE = 279, + TDATABASEADDMETADATA = 280, + TREPORTDETAILEDINIT = 281, + TREPORTBASE16 = 282, + TREPORTQUIET = 283, + TREPORTIGNOREE2FSATTRS = 284, + TCONFIG_FILE = 285, + TDATABASE = 286, + TDATABASE_OUT = 287, + TDATABASE_NEW = 288, + TDATABASE_ATTRS = 289, + TREPORT_URL = 290, + TGZIPDBOUT = 291, + TROOT_PREFIX = 292, + TUMASK = 293, + TTRUE = 294, + TFALSE = 295, + TRECSTOP = 296, + TCONFIG_VERSION = 297, + TSELRXRULE = 298, + TEQURXRULE = 299, + TNEGRXRULE = 300, + TRIGHTS = 301, + TUSER = 302, + TGROUP = 303, + TINODE = 304, + TLINKCOUNT = 305, + TFTYPE = 306, + TSIZE = 307, + TGROWINGSIZE = 308, + TATIME = 309, + TCTIME = 310, + TMTIME = 311, + TACL = 312, + TXATTRS = 313, + TSELINUX = 314, + TE2FSATTRS = 315, + TTIGER = 316, + TSHA1 = 317, + TRMD160 = 318, + TMD2 = 319, + TMD4 = 320, + TMD5 = 321, + TSHA256 = 322, + TSHA512 = 323, + TWHIRLPOOL = 324, + TL = 325, + TR = 326, + TGZIPHEADER = 327, + TDBSPEC = 328, + TUNKNOWN = 329, + TNAME = 330, + TERROR = 331, + TEOF = 332 + }; +#endif +/* Tokens. */ +#define TDEFINE 258 +#define TUNDEF 259 +#define TIFDEF 260 +#define TIFNDEF 261 +#define TIFNHOST 262 +#define TIFHOST 263 +#define TELSE 264 +#define TENDIF 265 +#define TINCLUDE 266 +#define TBEGIN_CONFIG 267 +#define TEND_CONFIG 268 +#define TBEGIN_DB 269 +#define TEND_DB 270 +#define TEND_DBNOMD 271 +#define TID 272 +#define TSTRING 273 +#define TACLNOSYMLINKFOLLOW 274 +#define TWARNDEADSYMLINKS 275 +#define TGROUPED 276 +#define TSUMMARIZECHANGES 277 +#define TNEWLINE 278 +#define TVERBOSE 279 +#define TDATABASEADDMETADATA 280 +#define TREPORTDETAILEDINIT 281 +#define TREPORTBASE16 282 +#define TREPORTQUIET 283 +#define TREPORTIGNOREE2FSATTRS 284 +#define TCONFIG_FILE 285 +#define TDATABASE 286 +#define TDATABASE_OUT 287 +#define TDATABASE_NEW 288 +#define TDATABASE_ATTRS 289 +#define TREPORT_URL 290 +#define TGZIPDBOUT 291 +#define TROOT_PREFIX 292 +#define TUMASK 293 +#define TTRUE 294 +#define TFALSE 295 +#define TRECSTOP 296 +#define TCONFIG_VERSION 297 +#define TSELRXRULE 298 +#define TEQURXRULE 299 +#define TNEGRXRULE 300 +#define TRIGHTS 301 +#define TUSER 302 +#define TGROUP 303 +#define TINODE 304 +#define TLINKCOUNT 305 +#define TFTYPE 306 +#define TSIZE 307 +#define TGROWINGSIZE 308 +#define TATIME 309 +#define TCTIME 310 +#define TMTIME 311 +#define TACL 312 +#define TXATTRS 313 +#define TSELINUX 314 +#define TE2FSATTRS 315 +#define TTIGER 316 +#define TSHA1 317 +#define TRMD160 318 +#define TMD2 319 +#define TMD4 320 +#define TMD5 321 +#define TSHA256 322 +#define TSHA512 323 +#define TWHIRLPOOL 324 +#define TL 325 +#define TR 326 +#define TGZIPHEADER 327 +#define TDBSPEC 328 +#define TUNKNOWN 329 +#define TNAME 330 +#define TERROR 331 +#define TEOF 332 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 45 "src/conf_yacc.y" /* yacc.c:1909 */ + + char* s; + DB_ATTR_TYPE i; + RESTRICTION_TYPE r; + +#line 214 "src/conf_yacc.h" /* yacc.c:1909 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE conflval; + +int confparse (void); + +#endif /* !YY_CONF_SRC_CONF_YACC_H_INCLUDED */ diff --git a/src/conf_yacc.y b/src/conf_yacc.y new file mode 100644 index 0000000..99d0433 --- /dev/null +++ b/src/conf_yacc.y @@ -0,0 +1,430 @@ +%{ + +/* + * Copyright (C) 1999-2006,2010-2013,2015,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * 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 "aide.h" +#include +#include +#include +#include +#include +#include "list.h" +#include "gen_list.h" +#include "db.h" +#include "db_config.h" +#include "symboltable.h" +#include "util.h" +#include "commandconf.h" + +DB_ATTR_TYPE retval=0; +extern int conflex(); +void conferror(const char*); + +extern char *conftext; +extern long conf_lineno; + + +%} +%union { + char* s; + DB_ATTR_TYPE i; + RESTRICTION_TYPE r; +} + + +%start lines + + +%token TDEFINE +%token TUNDEF +%token TIFDEF +%token TIFNDEF +%token TIFNHOST +%token TIFHOST +%token TELSE +%token TENDIF +%token TINCLUDE +%token TBEGIN_CONFIG +%token TEND_CONFIG +%token TBEGIN_DB +%token TEND_DB +%token TEND_DBNOMD +%token TID +%token TSTRING +%token '=' + +%token TACLNOSYMLINKFOLLOW +%token TWARNDEADSYMLINKS +%token TGROUPED +%token TSUMMARIZECHANGES +%token TNEWLINE +%token TVERBOSE +%token TDATABASEADDMETADATA +%token TREPORTDETAILEDINIT +%token TREPORTBASE16 +%token TREPORTQUIET +%token TREPORTIGNOREE2FSATTRS +%token TCONFIG_FILE +%token TDATABASE +%token TDATABASE_OUT +%token TDATABASE_NEW +%token TDATABASE_ATTRS +%token TREPORT_URL +%token TGZIPDBOUT +%token TROOT_PREFIX +%token TUMASK +%token TTRUE +%token TFALSE + +%token TRECSTOP +%token TCONFIG_VERSION + +/* File rule */ + +%token TSELRXRULE +%token TEQURXRULE +%token TNEGRXRULE + +/* expr alkiot */ + +%token TRIGHTS +%token TUSER +%token TGROUP +%token TINODE +%token TLINKCOUNT +%token TFTYPE +%token TSIZE +%token TGROWINGSIZE +%token TATIME +%token TCTIME +%token TMTIME +%token TACL +%token TXATTRS +%token TSELINUX +%token TE2FSATTRS + +/* hash funktions */ + +%token TTIGER +%token TSHA1 +%token TRMD160 +%token TMD2 +%token TMD4 +%token TMD5 +%token TSHA256 +%token TSHA512 +%token TWHIRLPOOL + +/* predefs */ + +%token TL +%token TR + +/* For db_lex */ +%token TGZIPHEADER +%token TDBSPEC +%token TUNKNOWN +%token TNAME +%token TERROR +%token TEOF + +%type restriction +%type expr +%type hash +%type primary other + +%left '+' '-' + +%% + +lines : lines line | ; + +line : rule | equrule | negrule | definestmt | undefstmt + | ifdefstmt | ifndefstmt | ifhoststmt | ifnhoststmt + | groupdef | db_in | db_out | db_new | db_attrs | verbose | report_detailed_init | config_version + | database_add_metadata | report | gzipdbout | root_prefix | report_base16 | report_quiet + | report_ignore_e2fsattrs | recursion_stopper | warn_dead_symlinks | grouped + | summarize_changes | acl_no_symlink_follow | beginconfigstmt | endconfigstmt + | TEOF { + newlinelastinconfig=1; + YYACCEPT; + } + | TNEWLINE + | TDBSPEC { + error(220,"Got @@dbspec.Stopping\n"); + YYACCEPT; + } + | TBEGIN_DB { + error(220,"Got @@begin_db. Stopping\n"); + YYACCEPT; + } + | TEND_DB { + conferror("Error while reading configuration"); + } + | error { + conferror("Error while reading configuration"); + YYABORT; + } ; + +rule : TSELRXRULE expr newlineoreof +{ decode_string($1); conf->selrxlst=append_rxlist($1,$2,conf->selrxlst, RESTRICTION_NULL); } ; + +equrule : TEQURXRULE expr newlineoreof +{ decode_string($1); conf->equrxlst=append_rxlist($1,$2,conf->equrxlst, RESTRICTION_NULL); } ; + +negrule : TNEGRXRULE newlineoreof +{ decode_string($1); conf->negrxlst=append_rxlist($1,0,conf->negrxlst, RESTRICTION_NULL); }; + +rule : TSELRXRULE restriction expr newlineoreof +{ decode_string($1); conf->selrxlst=append_rxlist($1,$3,conf->selrxlst, $2); } ; + +equrule : TEQURXRULE restriction expr newlineoreof +{ decode_string($1); conf->equrxlst=append_rxlist($1,$3,conf->equrxlst, $2); } ; + +negrule : TNEGRXRULE restriction newlineoreof +{ decode_string($1); conf->negrxlst=append_rxlist($1,0,conf->negrxlst, $2); }; + +newlineoreof : TNEWLINE | + TEOF { + newlinelastinconfig=0; + YYACCEPT; + } ; + +restriction : restriction ',' restriction { $$ =$1 | $3 ; } + | TSTRING { + if((retval=get_restrictionval($1)) != RESTRICTION_NULL) { + $$=retval; + } else { + conf_lineno++; + conferror("Error in restriction"); + YYABORT; + } + }; + +expr : expr '+' expr { $$ =$1 | $3 ; } | + expr '-' expr { $$ =$1 & (~$3 ); } | + primary { $$ =$1 ;} ; + +primary : hash { $$ =$1 ; } | + other { $$ =$1 ; } | + TSTRING { if((retval=get_groupval($1)) != DB_ATTR_UNDEF) { + $$=retval; + } + else { + conf_lineno++; // Hack + conferror("Error in expression"); + YYABORT; + } + } ; + +other : TRIGHTS { $$ =$1 ;} | TUSER {$$ =$1 ;} + | TGROUP {$$ =$1 ;} | TINODE {$$ =$1 ;} + | TLINKCOUNT {$$ =$1 ;} | TFTYPE {$$ =$1 ;} | TSIZE {$$ =$1 ;} + | TGROWINGSIZE {$$ =$1 ;} | TATIME {$$ =$1 ;} + | TCTIME {$$ =$1 ;} | TMTIME {$$ =$1 ;} | TL {$$ = $1;} + | TR {$$ = $1;} | TACL {$$ =$1 ;} | TXATTRS {$$ =$1 ;} + | TSELINUX {$$ =$1 ;} | TE2FSATTRS {$$ =$1 ;}; + +hash : TTIGER { $$ =$1 ;} | TSHA1 { $$ =$1 ;} | TRMD160 { $$ =$1 ;} + | TMD5 {$$ =$1 ;} | TSHA256 { $$ =$1 ;} | TSHA512 { $$ =$1 ;} + | TWHIRLPOOL { $$ =$1 ;}; + +definestmt : TDEFINE TSTRING TSTRING { do_define($2,$3); }; + +undefstmt : TUNDEF TSTRING { do_undefine($2); } ; + +ifdefstmt : TIFDEF TSTRING { + if(do_ifxdef(1,$2)==-1){ + error(0,"ifdef error\n"); + YYABORT; + }; + } ifstmtlist ; + +ifndefstmt : TIFNDEF TSTRING { + if(do_ifxdef(0,$2)==-1){ + error(0,"ifndef error\n"); + YYABORT; + }; + } ifstmtlist { error(220,"Ifndef statement ended\n");} ; + +ifhoststmt : TIFHOST TSTRING { + if(do_ifxhost(1,$2)==-1){ + error(0,"ifhost error\n"); + YYABORT; + }; + } ifstmtlist ; + +ifnhoststmt : TIFNHOST TSTRING { + if(do_ifxhost(0,$2)==-1){ + error(0,"ifnhost error\n"); + YYABORT; + }; + } ifstmtlist ; + +ifstmtlist : lines TENDIF { error(220,"Endif stmt matched\n");} | + lines TELSE lines TENDIF {error(220,"Endifelse stmt matched\n");} ; + +groupdef : TSTRING '=' expr { do_groupdef($1,$3); } ; + +db_in : TDATABASE TSTRING { do_dbdef(DB_OLD,$2); }; + +db_out : TDATABASE_OUT TSTRING { do_dbdef(DB_WRITE,$2); }; + +db_new : TDATABASE_NEW TSTRING { do_dbdef(DB_NEW,$2); }; + +verbose : TVERBOSE TSTRING { do_verbdef($2); }; + +report : TREPORT_URL TSTRING { do_repurldef($2); } ; + +db_attrs : TDATABASE_ATTRS expr { + DB_ATTR_TYPE attr; + if((attr = $2&(~DB_HASHES))){ + error(0, "%li: invalid attribute(s) in database_attrs: %llx\n", conf_lineno-1, attr); + YYABORT; + } + conf->db_attrs=$2; +} ; + +beginconfigstmt : TBEGIN_CONFIG TSTRING { +#ifdef WITH_MHASH + conf->do_configmd=1; + conf->old_confmdstr=strdup($2); +#endif +} ; + +endconfigstmt : TEND_CONFIG { + YYACCEPT; +} ; + +acl_no_symlink_follow : TACLNOSYMLINKFOLLOW TTRUE { +#ifdef WITH_ACL + conf->no_acl_on_symlinks=1; +#else + error(0,"ACL-support not compiled in.\n"); +#endif +} ; + +acl_no_symlink_follow : TACLNOSYMLINKFOLLOW TFALSE { +#ifdef WITH_ACL + conf->no_acl_on_symlinks=0; +#else + error(0,"ACL-support not compiled in.\n"); +#endif +} ; + +warn_dead_symlinks : TWARNDEADSYMLINKS TTRUE { + conf->warn_dead_symlinks=1; +} ; + +warn_dead_symlinks : TWARNDEADSYMLINKS TFALSE { + conf->warn_dead_symlinks=0; +} ; + +database_add_metadata : TDATABASEADDMETADATA TTRUE { + conf->database_add_metadata=1; +} ; + +database_add_metadata : TDATABASEADDMETADATA TFALSE { + conf->database_add_metadata=0; +} ; + +report_detailed_init : TREPORTDETAILEDINIT TTRUE { + conf->report_detailed_init=1; +} ; + +report_detailed_init : TREPORTDETAILEDINIT TFALSE { + conf->report_detailed_init=0; +} ; + +report_ignore_e2fsattrs : TREPORTIGNOREE2FSATTRS TSTRING { +#ifdef WITH_E2FSATTRS + do_report_ignore_e2fsattrs($2); +#else + error(0,"e2fsattrs-support not compiled in.\n"); +#endif +} ; + +report_base16 : TREPORTBASE16 TTRUE { + conf->report_base16=1; +} ; + +report_base16 : TREPORTBASE16 TFALSE { + conf->report_base16=0; +} ; + +report_quiet : TREPORTQUIET TTRUE { + conf->report_quiet=1; +} ; + +report_quiet : TREPORTQUIET TFALSE { + conf->report_quiet=0; +} ; + +grouped : TGROUPED TTRUE { + conf->grouped=1; +} ; + +root_prefix : TROOT_PREFIX TSTRING { do_rootprefix($2); }; + +grouped : TGROUPED TFALSE { + conf->grouped=0; +} ; + +summarize_changes : TSUMMARIZECHANGES TTRUE { + conf->summarize_changes=1; +} ; + +summarize_changes : TSUMMARIZECHANGES TFALSE { + conf->summarize_changes=0; +} ; + +gzipdbout : TGZIPDBOUT TTRUE { +#ifdef WITH_ZLIB +conf->gzip_dbout=1; +#else + error(0,"Gzip-support not compiled in.\n"); +#endif +} | + TGZIPDBOUT TFALSE { +#ifdef WITH_ZLIB +conf->gzip_dbout=0; +#endif +} ; + +recursion_stopper : TRECSTOP TSTRING { + /* FIXME implement me */ + +} ; + +config_version : TCONFIG_VERSION TSTRING { + conf->config_version=strdup($2); +} ; + +%% + + +void conferror(const char *msg){ + error(0,"%li:%s:%s\n",conf_lineno-1,msg,conftext); + +} + +const char* aide_key_1=CONFHMACKEY_01; +const char* db_key_1=DBHMACKEY_01; + diff --git a/src/db.c b/src/db.c new file mode 100644 index 0000000..dd133d4 --- /dev/null +++ b/src/db.c @@ -0,0 +1,893 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2006,2010,2011,2013 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include +#include +#include "db.h" +#include "db_file.h" +#include "db_disk.h" +#include "md.h" + +#ifdef WITH_PSQL +#include "db_sql.h" +#endif + +#include "db_config.h" +#include "report.h" +#include "be.h" + +#ifdef WITH_MHASH +#include +#endif + +#include "base64.h" +#include "util.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +db_line* db_char2line(char** ss,int db); +long readint(char* s,char* err); +AIDE_OFF_TYPE readlong(char* s,char* err); +long readoct(char* s,char* err); +time_t base64totime_t(char*); + +const char* db_names[db_unknown+1] = { + "name", + "lname", + "perm", + "uid", + "gid", + "size", + "atime", + "ctime", + "mtime", + "inode", + "bcount", + "lcount", + "md5", + "sha1", + "rmd160", + "tiger", + "crc32", + "haval", + "gost", + "crc32b", + "attr", + "acl", + "bsize", + "rdev", + "dev", + "checkmask", + "allownewfiles", + "allowrmfiles", + "sha256", + "sha512", + "whirlpool", + "selinux", + "xattrs", + "e2fsattrs", + "unknown"} ; + +const int db_value[db_unknown+1] = { + db_filename, /* "name", */ + db_linkname, /* "lname", */ + db_perm, /* "perm", */ + db_uid, /* "uid", */ + db_gid, /* "gid", */ + db_size, /* "size", */ + db_atime, /* "atime", */ + db_ctime, /* "ctime", */ + db_mtime, /* "mtime", */ + db_inode, /* "inode", */ + db_bcount, /* "bcount", */ + db_lnkcount, /* "lcount", */ + db_md5, /* "md5", */ + db_sha1, /* "sha1", */ + db_rmd160, /* "rmd160", */ + db_tiger, /* "tiger", */ + db_crc32, /* "crc32", */ + db_haval, /* "haval", */ + db_gost, /* "gost", */ + db_crc32b, /* "crc32b", */ + db_attr, /* attributes */ + db_acl, /* "acl" */ + db_bsize, /* "bsize" */ + db_rdev, /* "rdev" */ + db_dev, /* "dev" */ + db_checkmask, /* "checkmask" */ + db_allownewfile, /* "allownewfile" */ + db_allowrmfile, /* "allowrmfile" */ + db_sha256, /* "sha256", */ + db_sha512, /* "sha512", */ + db_whirlpool, /* "whirlpool", */ + db_selinux, /* "selinux", */ + db_xattrs, /* "xattrs", */ + db_e2fsattrs, /* "e2fsattrs", */ + db_unknown }; /* "unknown" */ + +const char* db_namealias[db_alias_size] = { + "count" } ; + +const int db_aliasvalue[db_alias_size] = { + db_lnkcount } ; /* "count", */ + +static struct md_container *init_db_attrs(URL_TYPE type) { + struct md_container *mdc = NULL; + if (conf->db_attrs) { + switch (type) { + case url_stdout: + case url_stderr: + case url_fd: + case url_file: + #ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: + #endif /* WITH CURL */ + mdc = malloc(sizeof(struct md_container)); /* freed in close_db_attrs */ + mdc->todo_attr = conf->db_attrs; + init_md(mdc); + break; + #ifdef WITH_PSQL + case url_sql: + break; + #endif /* WITH_PSQL */ + default : + error(200,_("init_db_attrs(): Unknown url type.\n")); + } + } + return mdc; +} + +static db_line *close_db_attrs (struct md_container *mdc, char *url_value) { + db_line *line = NULL; + if (mdc != NULL) { + close_md(mdc); + line = malloc(sizeof(struct db_line)); + line->filename = url_value; + line->perm = 0; + line->attr = conf->db_attrs; + md2line(mdc, line); + free(mdc); + } + return line; +} + +int db_init(int db) +{ + void* rv=NULL; + + error(200,"db_init %i\n",db); + + switch(db) { + + case DB_DISK: { + /* + Should we actually do something here? + */ + return db_disk_init(); + } + + + case DB_OLD: { + conf->mdc_in = init_db_attrs((conf->db_in_url)->type); + rv=be_init(1,conf->db_in_url,0); + if(rv==NULL) { + error(200,_("db_in is null\n")); + return RETFAIL; + } + conf->db_in=rv; + error(200,_("db_in is nonnull\n")); + return RETOK; + } + case DB_WRITE: { +#ifdef WITH_ZLIB + conf->mdc_out = init_db_attrs((conf->db_out_url)->type); + if(conf->gzip_dbout){ + rv=be_init(0,conf->db_out_url,conf->gzip_dbout); + conf->db_gzout=rv; + } + else{ +#endif + rv=be_init(0,conf->db_out_url,0); + conf->db_out=rv; +#ifdef WITH_ZLIB + } +#endif + + if(rv==NULL){ + error(200,_("db_out is null\n")); + return RETFAIL; + } + error(200,_("db_out is nonnull %s\n"),conf->db_out_url->value); + return RETOK; + } + case DB_NEW: { + conf->mdc_out = init_db_attrs((conf->db_new_url)->type); + rv=be_init(1,conf->db_new_url,0); + if(rv==NULL) { + error(200,_("db_new is null\n")); + return RETFAIL; + } + conf->db_new=rv; + error(200,_("db_new is nonnull\n")); + return RETOK; + } + } + return RETFAIL; +} + +db_line* db_readline(int db){ + db_line* s=NULL; + int i=0; + url_t* db_url=NULL; + FILE** db_filep=NULL; + int* db_osize=0; + DB_FIELD** db_order=NULL; + + switch (db) { + case DB_DISK: { + /* + Nothing else to be done? + */ + s=db_readline_disk(); + return s; + } + + case DB_OLD: { + db_url=conf->db_in_url; + db_filep=&(conf->db_in); + db_osize=&(conf->db_in_size); + db_order=&(conf->db_in_order); + break; + } + case DB_NEW: { + db_url=conf->db_new_url; + db_filep=&(conf->db_new); + db_osize=&(conf->db_new_size); + db_order=&(conf->db_new_order); + break; + } + } + + switch (db_url->type) { +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: +#endif /* WITH CURL */ + case url_stdin: + case url_fd: + case url_file: { + /* Should set errno */ + /* Please FIXME */ + if ((*db_filep)!=NULL) { + char** ss=db_readline_file(db); + if (ss!=NULL){ + s=db_char2line(ss,db); + + for(i=0;i<*db_osize;i++){ + if((*db_order)[i]!=db_unknown && + ss[(*db_order)[i]]!=NULL){ + free(ss[(*db_order)[i]]); + ss[(*db_order)[i]]=NULL; + } + } + free(ss); + + } + } + + break; + } + + +#ifdef WITH_PSQL + case url_sql: { + error(255,"db_sql readline..."); + s=db_readline_sql(db, conf); + + break; + } +#endif + default : { + error(0,_("db_readline():Url-type backend not implemented\n")); + return NULL; + } + } + + return s; + +} + +byte* base64tobyte(char* src,int len,size_t *ret_len) +{ + if(strcmp(src,"0")!=0){ + return decode_base64(src,len,ret_len); + } + return NULL; +} + +static char *db_readchar(char *s) +{ + if (s == NULL) + return (NULL); + + if (s[0] == '0') + { + if (s[1] == '\0') + return (NULL); + + if (s[1] == '-') + return (strdup("")); + + if (s[1] == '0') + { + memmove(s, s+1, strlen(s+1)+1); + // Hope this removes core + // dumping in some environments. Has something to do with + // memory (de)allocation. + } + } + + decode_string(s); + + return strdup(s); +} + +#define WARN_ONCE(x) case db_ ## x : { \ + static int warn_once_ ## x = 0; \ + if (! warn_once_ ## x ) \ + error(0,_("Hash %s uses MHASH, which is not enabled.\n"), \ + #x ); \ + warn_once_ ## x = 1; \ + } break + +db_line* db_char2line(char** ss,int db){ + + int i; + db_line* line=(db_line*)malloc(sizeof(db_line)*1); + int* db_osize=0; + DB_FIELD** db_order=NULL; + + switch (db) { + case DB_OLD: { + db_osize=&(conf->db_in_size); + db_order=&(conf->db_in_order); + break; + } + case DB_NEW: { + db_osize=&(conf->db_new_size); + db_order=&(conf->db_new_order); + break; + } + } + + + line->md5=NULL; + line->sha1=NULL; + line->rmd160=NULL; + line->tiger=NULL; + + line->crc32=NULL; /* MHASH stuff.. */ + line->crc32b=NULL; + line->haval=NULL; + line->gost=NULL; + line->whirlpool=NULL; + + line->sha256=NULL; + line->sha512=NULL; + line->perm=0; + line->uid=0; + line->gid=0; + line->atime=0; + line->ctime=0; + line->mtime=0; + line->inode=0; + line->nlink=0; + line->bcount=0; + line->size=0; + line->filename=NULL; + line->fullpath=NULL; + line->linkname=NULL; + line->acl=NULL; + line->xattrs=NULL; + line->e2fsattrs=0; + line->cntx=NULL; + + line->attr=conf->attr; /* attributes from @@dbspec */ + + for(i=0;i<*db_osize;i++){ + switch ((*db_order)[i]) { + case db_filename : { + if(ss[(*db_order)[i]]!=NULL){ + decode_string(ss[(*db_order)[i]]); + line->fullpath=strdup(ss[(*db_order)[i]]); + line->filename=line->fullpath; + } else { + error(0,"db_char2line():Error while reading database\n"); + exit(EXIT_FAILURE); + } + break; + } + case db_linkname : { + line->linkname = db_readchar(ss[(*db_order)[i]]); + break; + } + case db_mtime : { + line->mtime=base64totime_t(ss[(*db_order)[i]]); + break; + } + case db_bcount : { + line->bcount=readint(ss[(*db_order)[i]],"bcount"); + break; + } + case db_atime : { + line->atime=base64totime_t(ss[(*db_order)[i]]); + break; + } + case db_ctime : { + line->ctime=base64totime_t(ss[(*db_order)[i]]); + break; + } + case db_inode : { + line->inode=readint(ss[(*db_order)[i]],"inode"); + break; + } + + case db_uid : { + line->uid=readint(ss[(*db_order)[i]],"uid"); + break; + } + case db_gid : { + line->gid=readint(ss[(*db_order)[i]],"gid"); + break; + } + case db_size : { + line->size=readlong(ss[(*db_order)[i]],"size"); + break; + } + case db_md5 : { + line->md5=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_sha1 : { + line->sha1=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_rmd160 : { + line->rmd160=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_tiger : { + line->tiger=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_crc32 : { + line->crc32=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_haval : { + line->haval=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } +#ifdef WITH_MHASH + case db_gost : { + line->gost=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_crc32b : { + line->crc32b=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_whirlpool : { + line->whirlpool=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } +#else + WARN_ONCE(gost); + WARN_ONCE(crc32b); + WARN_ONCE(whirlpool); +#endif + case db_sha256 : { + line->sha256=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } + case db_sha512 : { + line->sha512=base64tobyte(ss[(*db_order)[i]], + strlen(ss[(*db_order)[i]]), NULL); + break; + } +#ifdef WITH_SUN_ACL + case db_acl : { + char* endp,*pos; + int entries,lc; + line->acl=NULL; + + entries=strtol(ss[(*db_order)[i]],&endp,10); + if (endp==ss[(*db_order)[i]]) { + /* Something went wrong */ + break; + } + pos=endp+1; /* Warning! if acl in database is corrupted then + this will break down. */ + + line->acl=malloc(sizeof(acl_type)); + line->acl->entries=entries; + line->acl->acl=malloc(sizeof(aclent_t)*entries); + for (lc=0;lcacl->acl[lc].a_type=strtol(pos,&endp,10); + pos=endp+1; + line->acl->acl[lc].a_id=strtol(pos,&endp,10); + pos=endp+1; + line->acl->acl[lc].a_perm=strtol(pos,&endp,10); + pos=endp+1; + } + break; + } +#endif +#ifdef WITH_POSIX_ACL + case db_acl : { + char *tval = NULL; + + tval = strtok(ss[(*db_order)[i]], ","); + + line->acl = NULL; + + if (tval[0] == '0') + line->acl = NULL; + else if (!strcmp(tval, "POSIX")) + { + line->acl = malloc(sizeof(acl_type)); + line->acl->acl_a = NULL; + line->acl->acl_d = NULL; + + tval = strtok(NULL, ","); + line->acl->acl_a = (char *)base64tobyte(tval, strlen(tval), NULL); + tval = strtok(NULL, ","); + line->acl->acl_d = (char *)base64tobyte(tval, strlen(tval), NULL); + } + /* else, it's broken... */ + break; + } +#endif + case db_xattrs : { + size_t num = 0; + char *tval = NULL; + + tval = strtok(ss[(*db_order)[i]], ","); + num = readlong(tval, "xattrs"); + if (num) + { + line->xattrs = malloc(sizeof(xattrs_type)); + line->xattrs->ents = calloc(sizeof(xattr_node), num); + line->xattrs->sz = num; + line->xattrs->num = num; + num = 0; + while (num < line->xattrs->num) + { + byte *val = NULL; + size_t vsz = 0; + + tval = strtok(NULL, ","); + line->xattrs->ents[num].key = db_readchar(strdup(tval)); + tval = strtok(NULL, ","); + val = base64tobyte(tval, strlen(tval), &vsz); + line->xattrs->ents[num].val = val; + line->xattrs->ents[num].vsz = vsz; + + ++num; + } + } + break; + } + + case db_selinux : { + byte *val = NULL; + + val = base64tobyte(ss[(*db_order)[i]], strlen(ss[(*db_order)[i]]),NULL); + line->cntx = (char *)val; + break; + } + + case db_perm : { + line->perm=readoct(ss[(*db_order)[i]],"permissions"); + break; + } + + case db_lnkcount : { + line->nlink=readint(ss[(*db_order)[i]],"nlink"); + break; + } + + case db_attr : { + line->attr=readlong(ss[(*db_order)[i]],"attr"); + break; + } + + case db_e2fsattrs : { + line->e2fsattrs=readlong(ss[(*db_order)[i]],"e2fsattrs"); + break; + } + + case db_unknown : { + /* Unknown fields are ignored. */ + break; + } + + default : { + error(0,_("Not implemented in db_char2line %i \n"),(*db_order)[i]); + return NULL; + } + + } + + } + + return line; +} + +time_t base64totime_t(char* s){ + + byte* b=decode_base64(s,strlen(s),NULL); + char* endp; + + if (b==NULL||strcmp(s,"0")==0) { + + /* Should we print error here? */ + free(b); + + return 0; + } else { + time_t t = strtol((char *)b,&endp,10); + + if (endp[0]!='\0') { + error(0,"Error converting base64\n"); + free(b); + return 0; + } + free(b); + return t; + } + + +} + +long readint(char* s,char* err){ + long i; + char* e; + i=strtol(s,&e,10); + if (e[0]!='\0') { + error(0,_("Could not read %s from database"),err); + } + return i; +} + +AIDE_OFF_TYPE readlong(char* s,char* err){ + AIDE_OFF_TYPE i; + char* e; + i=AIDE_STRTOLL_FUNC(s,&e,10); + if (e[0]!='\0') { + error(0,_("Could not read %s from database"),err); + } + return i; +} + +long readoct(char* s,char* err){ + long i; + char* e; + i=strtol(s,&e,8); + if (e[0]!='\0') { + error(0,_("Could not read %s from database. String %s \n"),err,s); + } + return i; +} + + +int db_writespec(db_config* dbconf) +{ + switch (dbconf->db_out_url->type) { + case url_stdout: + case url_stderr: + case url_fd: + case url_file: { + if( +#ifdef WITH_ZLIB + (dbconf->gzip_dbout && dbconf->db_gzout) || +#endif + (dbconf->db_out!=NULL)){ + if(db_writespec_file(dbconf)==RETOK){ + return RETOK; + } + } + break; + } +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: + { + + break; + } +#endif /* WITH CURL */ +#ifdef WITH_PSQL + case url_sql: { + if(dbconf->db_out!=NULL){ + if(db_writespec_sql(dbconf)==RETOK){ + return RETOK; + } + } + break; + } +#endif + default:{ + error(0,_("Unknown output in db out.\n")); + return RETFAIL; + } + } + return RETFAIL; +} + +int db_writeline(db_line* line,db_config* dbconf){ + + if (line==NULL||dbconf==NULL) return RETOK; + + switch (dbconf->db_out_url->type) { +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: +#endif /* WITH CURL */ + case url_stdout: + case url_stderr: + case url_fd: + case url_file: { + if ( +#ifdef WITH_ZLIB + (dbconf->gzip_dbout && dbconf->db_gzout) || +#endif + (dbconf->db_out!=NULL)) { + if (db_writeline_file(line,dbconf,dbconf->db_out_url)==RETOK) { + return RETOK; + } + } + return RETFAIL; + break; + } +#ifdef WITH_PSQL + case url_sql: { + if (dbconf->db_out!=NULL) { + if (db_writeline_sql(line,dbconf)==RETOK) { + return RETOK; + } + } + return RETFAIL; + break; + } +#endif + default : { + error(0,_("Unknown output in db out.\n")); + return RETFAIL; + } + } + return RETFAIL; +} + +void db_close() { + switch (conf->db_out_url->type) { + case url_stdout: + case url_stderr: + case url_fd: + case url_file: { + if ( +#ifdef WITH_ZLIB + (conf->gzip_dbout && conf->db_gzout) || +#endif + (conf->db_out!=NULL)) { + db_close_file(conf); + } + break; + } +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: + { + if (conf->db_out!=NULL) { + url_fclose(conf->db_out); + } + break; + } +#endif /* WITH CURL */ +#ifdef WITH_PSQL + case url_sql: { + if (conf->db_out!=NULL) { + db_close_sql(conf->db_out); + } + break; + } +#endif + default : { + error(0,_("db_close():Unknown output in db out.\n")); + } + } + conf->line_db_in = close_db_attrs(conf->mdc_in, (conf->db_in_url)->value); + conf->line_db_out = close_db_attrs(conf->mdc_out, (conf->action&DO_DIFF + ? conf->db_new_url : conf->db_out_url)->value); +} + +void free_db_line(db_line* dl) +{ + if (dl==NULL) { + return; + } + +#define checked_free(x) do { free(x); x=NULL; } while (0) + + checked_free(dl->md5); + checked_free(dl->sha1); + checked_free(dl->rmd160); + checked_free(dl->tiger); + dl->filename=NULL; + checked_free(dl->fullpath); + checked_free(dl->linkname); + +#ifdef WITH_MHASH + checked_free(dl->crc32); + checked_free(dl->crc32b); + checked_free(dl->gost); + checked_free(dl->haval); +#endif + + checked_free(dl->sha256); + checked_free(dl->sha512); + checked_free(dl->whirlpool); + + if (dl->acl) + { +#ifdef WITH_ACL + free(dl->acl->acl_a); + free(dl->acl->acl_d); +#endif + } + checked_free(dl->acl); + + if (dl->xattrs) + free(dl->xattrs->ents); + checked_free(dl->xattrs); + checked_free(dl->cntx); +} +const char* aide_key_5=CONFHMACKEY_05; +const char* db_key_5=DBHMACKEY_05; diff --git a/src/db_disk.c b/src/db_disk.c new file mode 100644 index 0000000..47e3e3e --- /dev/null +++ b/src/db_disk.c @@ -0,0 +1,453 @@ +/* aide, Advanced Intrusion Detection Environment + * vi: ts=2 sw=2 + * + * Copyright (C) 1999-2006,2010,2011,2016 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Mike Markley, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 199506L +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "seltree.h" +#include "gen_list.h" +#include "types.h" +#include "base64.h" +#include "db_disk.h" +#include "conf_yacc.h" +#include "util.h" +#include "commandconf.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#ifdef WITH_MHASH +#include +#endif + +#ifdef WITH_ZLIB +#include +#endif + +static DIR *dirh = NULL; +static struct AIDE_DIRENT_TYPE *entp = NULL; +static struct AIDE_DIRENT_TYPE **resp = NULL; + +static struct seltree *r = NULL; + + +#if defined HAVE_READDIR && !defined HAVE_READDIR_R +static long td = -1; +#endif +static int rdres = 0; + +static int root_handled = 0; + +static DIR *open_dir(char* path) { + if (dirh != NULL) { + if (closedir(dirh) != 0) { + /* Closedir did not success? */ + } + } + return opendir(path); +} + +static void next_in_dir (void) +{ +#ifdef HAVE_READDIR_R + if (dirh != NULL) + rdres = AIDE_READDIR_R_FUNC (dirh, entp, resp); +#else +#ifdef HAVE_READDIR + if (dirh != NULL) { + entp = AIDE_READDIR_FUNC (dirh); + if(entp!=NULL) + td = telldir(dirh); + else + td=-1; + } +#endif +#endif + +} + +static int in_this (void) +{ +#ifdef HAVE_READDIR_R + return (dirh != NULL && rdres == 0 && (*resp) != NULL); +#else +#ifdef HAVE_READDIR + return (dirh != NULL && entp != NULL && td >= 0); +#endif +#endif +} + +static char *name_construct (const char *s) +{ + char *ret; + int len2 = strlen (r->path); + int len = len2 + strlen (s) + 2 + conf->root_prefix_length; + + if (r->path[len2 - 1] != '/') { + len++; + } + + ret = (char *) malloc (len); + ret[0] = (char) 0; + strncpy(ret, conf->root_prefix, conf->root_prefix_length+1); + strncat (ret, r->path, len2); + if (r->path[len2 - 1] != '/') { + strncat (ret, "/", 1); + } + strcat (ret, s); + return ret; +} + +void add_child (db_line * fil) +{ + int i; + struct seltree *new_r; + + error (255, "Adding child %s\n", fil->filename); + + new_r = get_seltree_node (r, fil->filename); + if (new_r != NULL) { + if (S_ISDIR (fil->perm_o)) { + ; + } else { + new_r->checked |= NODE_CHECKED; + new_r->checked |= NODE_TRAVERSE; + } + return; + } + + new_r = malloc (sizeof (seltree)); + + new_r->attr = 0; + i = strlen (fil->filename); + + new_r->path = malloc (i + 1); + strncpy(new_r->path, fil->filename, i+1); + new_r->childs = NULL; + new_r->sel_rx_lst = NULL; + new_r->neg_rx_lst = NULL; + new_r->equ_rx_lst = NULL; + new_r->parent = r; + new_r->checked = 0; + new_r->new_data = NULL; + new_r->old_data = NULL; + if (S_ISDIR (fil->perm_o)) { + ; + } else { + new_r->checked |= NODE_CHECKED; + new_r->checked |= NODE_TRAVERSE; + } + r->childs = list_sorted_insert (r->childs, new_r, compare_node_by_path); +} + +static int get_file_status(char *filename, struct AIDE_STAT_TYPE *fs) { + int sres = 0; + sres = AIDE_LSTAT_FUNC(filename,fs); + if(sres == -1){ + char* er = strerror(errno); + if (er == NULL) { + error(0,"get_file_status: lstat() failed for %s. strerror() failed for %i\n", filename, errno); + } else { + error(0,"get_file_status: lstat() failed for %s: %s\n", filename, er); + } + } + return sres; +} + +/* + It might be a good idea to make this non recursive. + Now implemented with goto-statement. Yeah, it's ugly and easy. +*/ + +db_line *db_readline_disk () +{ + db_line *fil = NULL; + DB_ATTR_TYPE attr; + char *fullname; + int add = 0; + struct AIDE_STAT_TYPE fs; + + /* root needs special handling */ + if (!root_handled) { + root_handled = 1; + fullname=malloc((conf->root_prefix_length+2)*sizeof(char)); + strncpy(fullname, conf->root_prefix, conf->root_prefix_length+1); + strncat (fullname, "/", 1); + if (!get_file_status(&fullname[conf->root_prefix_length], &fs)) { + add = check_rxtree (&fullname[conf->root_prefix_length], conf->tree, &attr, fs.st_mode); + error (240, "%s match=%d, tree=%p, attr=%llu\n", &fullname[conf->root_prefix_length], add, + conf->tree, attr); + + if (add > 0) { + fil = get_file_attrs (fullname, attr, &fs); + + error (240, "%s attr=%llu\n", &fullname[conf->root_prefix_length], attr); + + if (fil != NULL) { + error (240, "%s attr=%llu\n", fil->filename, fil->attr); + return fil; + } + } + } + free (fullname); + } +recursion: + next_in_dir (); + + if (in_this ()) { + + /* + Let's check if we have '.' or '..' entry. + If have, just skipit. + If don't do the 'normal' thing. + */ + if (strcmp (entp->d_name, ".") == 0 || strcmp (entp->d_name, "..") == 0) { + goto recursion; // return db_readline_disk(db); + } + + /* + Now we know that we actually can do something. + */ + + fullname = name_construct (entp->d_name); + + /* + Now we have a filename, which we must remember to free if it is + not used. + + Next thing is to see if we want to do something with it. + If not call, db_readline_disk again... + */ + + if (get_file_status(&fullname[conf->root_prefix_length], &fs)) { + free (fullname); + goto recursion; + } + add = check_rxtree (&fullname[conf->root_prefix_length], conf->tree, &attr, fs.st_mode); + error (240, "%s match=%d, tree=%p, attr=%llu\n", &fullname[conf->root_prefix_length], add, + conf->tree, attr); + + if (add > 0) { + fil = get_file_attrs (fullname, attr, &fs); + + error (240, "%s attr=%llu\n", &fullname[conf->root_prefix_length], attr); + + if (fil != NULL) { + error (240, "%s attr=%llu\n", fil->filename, fil->attr); + } else { + /* + Something went wrong during read process -> + Let's try next one. + */ + free (fullname); + goto recursion; // return db_readline_disk(db); + } + + if (add == 1) { + /* + add_children -> if dir, then add to children list. + */ + /* If ee are adding a file that is not a dir */ + /* add_child can make the determination and mark the tree + accordingly + */ + add_child (fil); + } else if (add == 2) { + /* + Don't add to children list. + */ + + /* + Should we do something? + */ + } + } else { + /* + Make us traverse the tree:) + */ + + /* + We have no use for fullname. + */ + + free (fullname); + goto recursion; + } + /* + Make sure that next time we enter + we have something. + */ + } else { + + if (r == NULL) { + return NULL; + } + + error (255, "r->childs %p, r->parent %p, r->checked %i\n", r->childs, + r->parent, r->checked); + + if ((0 == (r->checked & NODE_CHECKED)) && r->childs != NULL) { + seltree *rr; + list *l; + l = r->childs->header->head; + + while (l != NULL + && (((seltree *) (l->data))->checked & NODE_TRAVERSE) != 0) { + l = l->next; + } + if (l != NULL) { + if (l == l->header->tail) { + r->checked |= NODE_CHECKED; + } + + rr = (seltree *) l->data; + + error (255, "rr->checked %i\n", rr->checked); + rr->checked |= NODE_TRAVERSE; + + r = rr; + + error (255, "r->childs %p, r->parent %p,r->checked %i\n", + r->childs, r->parent, r->checked); + fullname=malloc((conf->root_prefix_length+strlen(r->path)+1)*sizeof(char)); + strncpy(fullname, conf->root_prefix, conf->root_prefix_length+1); + strncat(fullname, r->path, strlen(r->path)); + dirh=open_dir(fullname); + if (! dirh) { + + /* open_dir failed so we need to know why and print + an errormessage if needed. + errno should still be the one from opendir() since it's global + */ + if (errno == ENOENT && r->old_data != NULL && + r->sel_rx_lst == NULL && r->neg_rx_lst == NULL && + r->equ_rx_lst == NULL) { + /* The path did not exist and there is old data for this node + and there are no regexps for this node + There is no new data for this node otherwise it would not + come to this part of the code. + So we don't print any error message. + */ + } else if (errno == ENOENT && + ((r->sel_rx_lst != NULL || r->neg_rx_lst != NULL || + r->equ_rx_lst != NULL) || r->childs != NULL)) { + /* The dir did not exist and there are regexps referring to + this node or there are children to this node. + The only way a nonexistent dirnode can have children is by + having rules referring to them. + */ + error (10, + "There are rules referring to non-existent directory %s\n", fullname); + } else if (errno != ENOTDIR) { + /* We print the message unless it is "Not a directory". */ + char *er = strerror (errno); + if (er != NULL) { + error (3, "open_dir(): %s: %s\n", er, fullname); + } else { + error (3, "open_dir(): %i: %s\n", errno, fullname); + } + } + r->checked |= NODE_TRAVERSE | NODE_CHECKED; + r = r->parent; + error (255, "dropping back to parent\n"); + } + free(fullname); + } else { + r->checked |= NODE_TRAVERSE | NODE_CHECKED; + r = r->parent; + /* We have gone out of the tree. This happens in some instances */ + if (r == NULL) { + return NULL; + } + error (255, "dropping back to parent\n"); + } + goto recursion; + } + + if (r->parent != NULL) { + /* + Go back in time:) + */ + r->checked |= NODE_CHECKED; + + r = r->parent; + + goto recursion; + } + /* + The end has been reached. Nothing to do. + */ + } + + return fil; +} + +int db_disk_init () +{ + + r = conf->tree; + +# ifdef HAVE_READDIR_R + resp = (struct AIDE_DIRENT_TYPE **) + malloc (sizeof (struct AIDE_DIRENT_TYPE) + _POSIX_PATH_MAX); + entp = (struct AIDE_DIRENT_TYPE *) + malloc (sizeof (struct AIDE_DIRENT_TYPE) + _POSIX_PATH_MAX); +# else +# ifdef HAVE_READDIR + /* + Should we do something here? + + */ +# else +# error AIDE needs readdir or readdir_r +# endif +# endif + + + char* fullname=malloc((conf->root_prefix_length+2)*sizeof(char)); + strncpy(fullname, conf->root_prefix, conf->root_prefix_length+1); + strncat (fullname, "/", 1); + dirh=open_dir(fullname); + free(fullname); + + return RETOK; +} + +/* + We don't support writing to the pseudo-database disk, since we are'n a + backup/restore software. Hence the functions db_writespec_disk, + db_writeline_disk and db_close_disk aren't declared. + */ + +const char *aide_key_6 = CONFHMACKEY_06; +const char *db_key_6 = DBHMACKEY_06; diff --git a/src/db_file.c b/src/db_file.c new file mode 100644 index 0000000..94bd16d --- /dev/null +++ b/src/db_file.c @@ -0,0 +1,1121 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2007,2010-2013,2016 Rami Lehti, Pablo Virolainen, Mike + * Markley, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include +#include +#include +#include +#include + +#include + +#include "types.h" +#include "base64.h" +#include "db_file.h" +#include "gen_list.h" +#include "conf_yacc.h" +#include "util.h" +#include "commandconf.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#ifdef WITH_MHASH +#include +#endif + +#ifdef WITH_ZLIB +#include +#endif + +#define BUFSIZE 16384 + +#include "md.h" + +#ifdef WITH_ZLIB +#define ZBUFSIZE 16384 + +static int dofprintf( const char* s,...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))); +#else + ; +#endif + +/* FIXME get rid of this */ +void handle_gzipped_input(int out,gzFile* gzp){ + + int nread=0; + int err=0; + int* buf=malloc(ZBUFSIZE); + buf[0]='\0'; + error(200,"handle_gzipped_input(),%d\n",out); + while(!gzeof(*gzp)){ + if((nread=gzread(*gzp,buf,ZBUFSIZE))<0){ + error(0,_("gzread() failed: gzerr=%s!\n"),gzerror(*gzp,&err)); + exit(1); + } else { + int tmp = 0; + + /* gzread returns 0 even if uncompressed bytes were read */ + if(nread==0){ + tmp = strlen((char*)buf); + } else { + tmp = nread; + } + if (write(out, buf,nread) != tmp) + { + error(0,_("write() failed: %s\n"), strerror(errno)); + exit(1); + } + + error(240,"nread=%d,strlen(buf)=%lu,errno=%s,gzerr=%s\n", + nread,(unsigned long)strlen((char*)buf),strerror(errno), + gzerror(*gzp,&err)); + buf[0]='\0'; + } + } + close(out); + error(240,"handle_gzipped_input() exiting\n"); + exit(0); + /* NOT REACHED */ + return; +} +#endif + + +int dofflush(void) +{ + + int retval; +#ifdef WITH_ZLIB + if(conf->gzip_dbout){ + /* Should not flush using gzip, it degrades compression */ + retval=Z_OK; + }else { +#endif + retval=fflush(conf->db_out); +#ifdef WITH_ZLIB + } +#endif + + return retval; +} + +int dofprintf( const char* s,...) +{ + char buf[3]; + int retval; + char* temp=NULL; + va_list ap; + + va_start(ap,s); + retval=vsnprintf(buf,3,s,ap); + va_end(ap); + + temp=(char*)malloc(retval+2); + if(temp==NULL){ + error(0,"Unable to alloc %i bytes\n",retval+2); + return -1; + } + va_start(ap,s); + retval=vsnprintf(temp,retval+1,s,ap); + va_end(ap); + + if (conf->mdc_out) { + update_md(conf->mdc_out,temp ,retval); + } + +#ifdef WITH_MHASH + if(conf->do_dbnewmd) + mhash(conf->dbnewmd,(void*)temp,retval); +#endif + +#ifdef WITH_ZLIB + if(conf->gzip_dbout){ + retval=gzwrite(conf->db_gzout,temp,retval); + }else{ +#endif + /* writing is ok with fwrite with curl.. */ + retval=fwrite(temp,1,retval,conf->db_out); +#ifdef WITH_ZLIB + } +#endif + free(temp); + + return retval; +} + + + +int db_file_read_spec(int db){ + + int i=0; + int* db_osize=0; + DB_FIELD** db_order=NULL; + + switch (db) { + case DB_OLD: { + db_osize=&(conf->db_in_size); + db_order=&(conf->db_in_order); + db_lineno=&db_in_lineno; + break; + } + case DB_NEW: { + db_osize=&(conf->db_new_size); + db_order=&(conf->db_new_order); + db_lineno=&db_new_lineno; + break; + } + } + + *db_order=(DB_FIELD*) malloc(1*sizeof(DB_FIELD)); + + while ((i=db_scan())!=TNEWLINE){ + switch (i) { + + case TID : { + int l; + + + /* Yes... we do not check if realloc returns nonnull */ + + *db_order=(DB_FIELD*) + realloc((void*)*db_order, + ((*db_osize)+1)*sizeof(DB_FIELD)); + + if(*db_order==NULL){ + return RETFAIL; + } + + (*db_order)[*db_osize]=db_unknown; + + for (l=0;lattr=-1; + + for (i=0;i<*db_osize;i++) { + if ((*db_order)[i]==db_attr) { + conf->attr=1; + } + } + if (conf->attr==DB_ATTR_UNDEF) { + conf->attr=0; + error(0,"Database does not have attr field.\nComparation may be incorrect\nGenerating attr-field from dbspec\nIt might be a good Idea to regenerate databases. Sorry.\n"); + for(i=0;idb_in_size;i++) { + conf->attr|=1<<(*db_order)[i]; + } + } + return RETOK; +} + +char** db_readline_file(int db){ + + char** s=NULL; + + int i=0; + int r; + int a=0; + int token=0; + int gotbegin_db=0; + int gotend_db=0; + int* domd=NULL; +#ifdef WITH_MHASH + MHASH* md=NULL; +#endif + char** oldmdstr=NULL; + int* db_osize=0; + DB_FIELD** db_order=NULL; + FILE** db_filep=NULL; + url_t* db_url=NULL; + + switch (db) { + case DB_OLD: { +#ifdef WITH_MHASH + md=&(conf->dboldmd); +#endif + domd=&(conf->do_dboldmd); + oldmdstr=&(conf->old_dboldmdstr); + + db_osize=&(conf->db_in_size); + db_order=&(conf->db_in_order); + db_filep=&(conf->db_in); + db_url=conf->db_in_url; + db_lineno=&db_in_lineno; + break; + } + case DB_NEW: { +#ifdef WITH_MHASH + md=&(conf->dbnewmd); +#endif + domd=&(conf->do_dbnewmd); + oldmdstr=&(conf->old_dbnewmdstr); + + db_osize=&(conf->db_new_size); + db_order=&(conf->db_new_order); + db_filep=&(conf->db_new); + db_url=conf->db_new_url; + db_lineno=&db_new_lineno; + break; + } + } + + if (*db_osize==0) { + db_buff(db,*db_filep); + + token=db_scan(); + while((token!=TDBSPEC && token!=TEOF)){ + + switch(token){ + case TUNKNOWN: { + continue; + } + case TBEGIN_DB: { + token=db_scan(); + gotbegin_db=1; + continue; + } + case TNEWLINE: { + if(gotbegin_db){ + *domd=1; + token=db_scan(); + continue; + }else { + token=TEOF; + break; + } + } + case TGZIPHEADER: { + error(0,"Gzipheader found inside uncompressed db!\n"); + return NULL; + } + default: { + /* If it is anything else we quit */ + /* Missing dbspec */ + token=TEOF; + break; + } + } + } + + if(FORCEDBMD&&!gotbegin_db){ + error(0,"Database %i does not have checksum!\n",db); + return NULL; + } + + if (token!=TDBSPEC) { + /* + * error.. must be a @@dbspec line + */ + + switch (db_url->type) { + case url_file : { + error(0,"File database must have one db_spec specification\n"); + break; + } + + case url_stdin : { + error(0,"Pipe database must have one db_spec specification\n"); + break; + } + + case url_fd: { + error(0,"FD database must have one db_spec specification\n"); + break; + } +#ifdef WITH_CURL + case url_http: + case url_https: + case url_ftp: { + error(0,"CURL database must have one db_spec specification %i\n",token); + break; + } +#endif + + default : { + error(0,"db_readline_file():Unknown or unsupported db in type.\n"); + + break; + } + + } + return s; + } + + /* + * Here we read da spec + */ + + if (db_file_read_spec(db)!=0) { + /* somethin went wrong */ + return s; + } + + }else { + /* We need to switch the buffer cleanly*/ + db_buff(db,NULL); + } + + s=(char**)malloc(sizeof(char*)*db_unknown); + + /* We NEED this to avoid Bus errors on Suns */ + for(i=0;idbhmactype)); + mhash_deinit(*md,(void*)dig); + digstr=encode_base64(dig,mhash_get_block_size(conf->dbhmactype)); + if(strncmp(digstr,*oldmdstr,strlen(digstr))!=0){ + error(0,_("Db checksum mismatch for db:%i\n"),db); + abort(); + } + } + else + { + error(0,"@@end_db found without @@begin_db in db:%i\n",db); + abort(); + } +#endif + } + token=db_scan(); + if(token!=TNEWLINE){ + error(0,_("Corrupt db. Checksum garbled\n")); + abort(); + } + break; + } + + case TEND_DBNOMD : { + gotend_db=1; + if(FORCEDBMD){ + error(0,"Database %i does not have checksum!\n",db); + abort(); + } + break; + } + + case TEOF : { + if(gotend_db){ + return NULL; + } + /* This can be the first token on a line */ + if(i>0){ + error(0,"Not enough parameters in db:%li\n",*db_lineno); + }; + for(a=0;ado_dbnewmd=1; + if( (dbconf->dbnewmd= + mhash_hmac_init(dbconf->dbhmactype, + key, + keylen, + mhash_get_hash_pblock(dbconf->dbhmactype)))== + MHASH_FAILED){ + error(0, "mhash_hmac_init() failed for db write. Aborting\n"); + abort(); + } + } + + +#endif + + if(dbconf->database_add_metadata) { + retval=dofprintf( + "# This file was generated by Aide, version %s\n" + "# Time of generation was %.4u-%.2u-%.2u %.2u:%.2u:%.2u\n", + AIDEVERSION, + st->tm_year+1900, st->tm_mon+1, st->tm_mday, + st->tm_hour, st->tm_min, st->tm_sec + ); + if(retval==0){ + return RETFAIL; + } + } + if(dbconf->config_version){ + retval=dofprintf( + "# The config version used to generate this file was:\n" + "# %s\n", dbconf->config_version); + if(retval==0){ + return RETFAIL; + } + } + retval=dofprintf("@@db_spec "); + if(retval==0){ + return RETFAIL; + } + for(i=0;idb_out_size;i++){ + for(j=0;jdb_out_order[i]){ + retval=dofprintf("%s ",db_names[j]); + if(retval==0){ + return RETFAIL; + } + break; + } + } + } + retval=dofprintf("\n"); + if(retval==0){ + return RETFAIL; + } + return RETOK; +} + +#ifdef WITH_ACL +int db_writeacl(acl_type* acl,FILE* file,int a) +{ +#ifdef WITH_SUN_ACL + int i; + + if(a) { + dofprintf(" "); + } + + if (acl==NULL) { + dofprintf("0"); + } else { + + dofprintf("%i",acl->entries); + + for (i=0;ientries;i++) { + dofprintf(",%i,%i,%i", acl->acl[i].a_type, acl->acl[i].a_id, + acl->acl[i].a_perm); + } + } +#endif +#ifdef WITH_POSIX_ACL + if(a) { + dofprintf(" "); + } + + if (acl==NULL) { + dofprintf("0"); + } else { + dofprintf("POSIX"); /* This is _very_ incompatible */ + + dofprintf(","); + if (acl->acl_a) + db_write_byte_base64((byte*)acl->acl_a, 0, file,0,1,1); + else + dofprintf("0"); + dofprintf(","); + if (acl->acl_d) + db_write_byte_base64((byte*)acl->acl_d, 0, file,0,1,1); + else + dofprintf("0"); + } +#endif +#ifndef WITH_ACL + if(a) { /* compat. */ + dofprintf(" "); + } + + dofprintf("0"); +#endif + + return RETOK; +} +#endif + +int db_writeline_file(db_line* line,db_config* dbconf, url_t* url){ + int i; + + (void)url; + + for(i=0;idb_out_size;i++){ + switch (dbconf->db_out_order[i]) { + case db_filename : { + db_writechar(line->filename,dbconf->db_out,i); + break; + } + case db_linkname : { + db_writechar(line->linkname,dbconf->db_out,i); + break; + } + case db_bcount : { + db_writeint(line->bcount,dbconf->db_out,i); + break; + } + + case db_mtime : { + db_write_time_base64(line->mtime,dbconf->db_out,i); + break; + } + case db_atime : { + db_write_time_base64(line->atime,dbconf->db_out,i); + break; + } + case db_ctime : { + db_write_time_base64(line->ctime,dbconf->db_out,i); + break; + } + case db_inode : { + db_writeint(line->inode,dbconf->db_out,i); + break; + } + case db_lnkcount : { + db_writeint(line->nlink,dbconf->db_out,i); + break; + } + case db_uid : { + db_writeint(line->uid,dbconf->db_out,i); + break; + } + case db_gid : { + db_writeint(line->gid,dbconf->db_out,i); + break; + } + case db_size : { + db_writelong(line->size,dbconf->db_out,i); + break; + } + case db_md5 : { + db_write_byte_base64(line->md5, + HASH_MD5_LEN, + dbconf->db_out,i, + DB_MD5,line->attr); + + break; + } + case db_sha1 : { + db_write_byte_base64(line->sha1, + HASH_SHA1_LEN, + dbconf->db_out,i, + DB_SHA1,line->attr); + + break; + } + case db_rmd160 : { + db_write_byte_base64(line->rmd160, + HASH_RMD160_LEN, + dbconf->db_out,i, + DB_RMD160,line->attr); + break; + } + case db_tiger : { + db_write_byte_base64(line->tiger, + HASH_TIGER_LEN, + dbconf->db_out,i, + DB_TIGER,line->attr); + break; + } + case db_perm : { + db_writeoct(line->perm,dbconf->db_out,i); + break; + } + case db_crc32 : { + db_write_byte_base64(line->crc32, + HASH_CRC32_LEN, + dbconf->db_out,i, + DB_CRC32,line->attr); + break; + } + case db_crc32b : { + db_write_byte_base64(line->crc32b, + HASH_CRC32B_LEN, + dbconf->db_out,i, + DB_CRC32B,line->attr); + break; + } + case db_haval : { + db_write_byte_base64(line->haval, + HASH_HAVAL256_LEN, + dbconf->db_out,i, + DB_HAVAL,line->attr); + break; + } + case db_gost : { + db_write_byte_base64(line->gost , + HASH_GOST_LEN, + dbconf->db_out,i, + DB_GOST,line->attr); + break; + } + case db_sha256 : { + db_write_byte_base64(line->sha256, + HASH_SHA256_LEN, + dbconf->db_out,i, + DB_SHA256,line->attr); + + break; + } + case db_sha512 : { + db_write_byte_base64(line->sha512, + HASH_SHA512_LEN, + dbconf->db_out,i, + DB_SHA512,line->attr); + + break; + } + case db_whirlpool : { + db_write_byte_base64(line->whirlpool, + HASH_WHIRLPOOL_LEN, + dbconf->db_out,i, + DB_WHIRLPOOL,line->attr); + + break; + } + case db_attr : { + db_writelong(line->attr, dbconf->db_out,i); + break; + } +#ifdef WITH_ACL + case db_acl : { + db_writeacl(line->acl,dbconf->db_out,i); + break; + } +#endif + case db_xattrs : { + xattr_node *xattr = NULL; + size_t num = 0; + + if (!line->xattrs) + { + db_writelong(0, dbconf->db_out, i); + break; + } + + db_writelong(line->xattrs->num, dbconf->db_out, i); + + xattr = line->xattrs->ents; + while (num < line->xattrs->num) + { + dofprintf(","); + db_writechar(xattr->key, dbconf->db_out, 0); + dofprintf(","); + db_write_byte_base64(xattr->val, xattr->vsz, dbconf->db_out, 0, 1, 1); + + ++xattr; + ++num; + } + break; + } + case db_selinux : { + db_write_byte_base64((byte*)line->cntx, 0, dbconf->db_out, i, 1, 1); + break; + } +#ifdef WITH_E2FSATTRS + case db_e2fsattrs : { + db_writelong(line->e2fsattrs,dbconf->db_out,i); + break; + } +#endif + case db_checkmask : { + db_writeoct(line->attr,dbconf->db_out,i); + break; + } + default : { + error(0,"Not implemented in db_writeline_file %i\n", + dbconf->db_out_order[i]); + return RETFAIL; + } + + } + + } + + dofprintf("\n"); + /* Can't use fflush because of zlib.*/ + dofflush(); + + return RETOK; +} + +int db_close_file(db_config* dbconf){ + +#ifdef WITH_MHASH + byte* dig=NULL; + char* digstr=NULL; + + if(dbconf->db_out +#ifdef WITH_ZLIB + || dbconf->db_gzout +#endif + ){ + + /* Let's write @@end_db */ + if (dbconf->dbnewmd!=NULL) { + mhash(dbconf->dbnewmd, NULL ,0); + dig=(byte*)malloc(sizeof(byte)*mhash_get_block_size(dbconf->dbhmactype)); + mhash_deinit(dbconf->dbnewmd,(void*)dig); + digstr=encode_base64(dig,mhash_get_block_size(dbconf->dbhmactype)); + dbconf->do_dbnewmd=0; + dofprintf("@@end_db %s\n",digstr); + free(dig); + free(digstr); + } else { + dofprintf("@@end_db\n"); + } + } +#endif + +#ifndef WITH_ZLIB + if(fclose(dbconf->db_out)){ + error(0,"Unable to close database:%s\n",strerror(errno)); + return RETFAIL; + } +#else + if(dbconf->gzip_dbout){ + if(gzclose(dbconf->db_gzout)){ + error(0,"Unable to close gzdatabase:%s\n",strerror(errno)); + return RETFAIL; + } + }else { + if(fclose(dbconf->db_out)){ + error(0,"Unable to close database:%s\n",strerror(errno)); + return RETFAIL; + } + } +#endif + + return RETOK; +} +// vi: ts=8 sw=8 diff --git a/src/db_lex.c b/src/db_lex.c new file mode 100644 index 0000000..d3fdb71 --- /dev/null +++ b/src/db_lex.c @@ -0,0 +1,1975 @@ +#line 2 "src/db_lex.c" + +#line 4 "src/db_lex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer db_create_buffer +#define yy_delete_buffer db_delete_buffer +#define yy_flex_debug db_flex_debug +#define yy_init_buffer db_init_buffer +#define yy_flush_buffer db_flush_buffer +#define yy_load_buffer_state db_load_buffer_state +#define yy_switch_to_buffer db_switch_to_buffer +#define yyin dbin +#define yyleng dbleng +#define yylex dblex +#define yylineno dblineno +#define yyout dbout +#define yyrestart dbrestart +#define yytext dbtext +#define yywrap dbwrap +#define yyalloc dballoc +#define yyrealloc dbrealloc +#define yyfree dbfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 +#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 + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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 dbrestart(dbin ) + +#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 yy_size_t dbleng; + +extern FILE *dbin, *dbout; + +#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 dbtext. */ \ + 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 dbtext 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. + */ + yy_size_t 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 dbrestart()), so that the user can continue scanning by + * just pointing dbin 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 = 0; /**< 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 dbtext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t dbleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow dbwrap()'s to do buffer switches + * instead of setting up a fresh dbin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void dbrestart (FILE *input_file ); +void db_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE db_create_buffer (FILE *file,int size ); +void db_delete_buffer (YY_BUFFER_STATE b ); +void db_flush_buffer (YY_BUFFER_STATE b ); +void dbpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void dbpop_buffer_state (void ); + +static void dbensure_buffer_stack (void ); +static void db_load_buffer_state (void ); +static void db_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER db_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE db_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE db_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE db_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *dballoc (yy_size_t ); +void *dbrealloc (void *,yy_size_t ); +void dbfree (void * ); + +#define yy_new_buffer db_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + dbensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + db_create_buffer(dbin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + dbensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + db_create_buffer(dbin,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 unsigned char YY_CHAR; + +FILE *dbin = (FILE *) 0, *dbout = (FILE *) 0; + +typedef int yy_state_type; + +extern int dblineno; + +int dblineno = 1; + +extern char *dbtext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr dbtext + +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 ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up dbtext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + dbleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 13 +#define YY_END_OF_BUFFER 14 +/* 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 yyconst flex_int16_t yy_accept[46] = + { 0, + 0, 0, 0, 0, 14, 12, 10, 11, 9, 12, + 12, 12, 12, 5, 9, 0, 8, 0, 1, 0, + 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, + 2, 7, 4, 3, 0 + } ; + +static yyconst 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, + 4, 5, 6, 2, 7, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 1, 6, 1, + 6, 1, 6, 9, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 1, 1, 1, 1, 10, 1, 8, 11, 12, 13, + + 14, 8, 15, 8, 16, 8, 8, 8, 8, 17, + 8, 18, 8, 8, 19, 8, 8, 8, 8, 8, + 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 20, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 21, 21, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 21, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 21, 21, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 21, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst YY_CHAR yy_meta[22] = + { 0, + 1, 1, 1, 1, 1, 2, 1, 3, 1, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, + 4 + } ; + +static yyconst flex_uint16_t yy_base[50] = + { 0, + 0, 18, 27, 45, 85, 86, 86, 86, 0, 81, + 74, 62, 72, 0, 0, 77, 86, 66, 86, 12, + 0, 0, 67, 63, 59, 65, 59, 60, 53, 55, + 60, 51, 51, 54, 52, 55, 42, 40, 38, 45, + 0, 13, 86, 0, 86, 53, 56, 59, 60 + } ; + +static yyconst flex_int16_t yy_def[50] = + { 0, + 45, 1, 45, 3, 45, 45, 45, 45, 46, 47, + 45, 45, 45, 48, 46, 47, 45, 49, 45, 49, + 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 45, 49, 0, 45, 45, 45, 45 + } ; + +static yyconst flex_uint16_t yy_nxt[108] = + { 0, + 6, 7, 8, 6, 7, 9, 10, 9, 11, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, + 6, 12, 24, 44, 23, 25, 13, 6, 7, 8, + 6, 7, 14, 10, 14, 11, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 6, 6, 12, 43, + 42, 41, 40, 13, 15, 15, 16, 16, 16, 16, + 21, 21, 22, 22, 39, 38, 37, 36, 35, 34, + 33, 32, 31, 30, 29, 28, 27, 26, 23, 17, + 20, 19, 18, 17, 45, 5, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + + 45, 45, 45, 45, 45, 45, 45 + } ; + +static yyconst flex_int16_t yy_chk[108] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 20, 42, 20, 20, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 40, + 39, 38, 37, 4, 46, 46, 47, 47, 47, 47, + 48, 48, 49, 49, 36, 35, 34, 33, 32, 31, + 30, 29, 28, 27, 26, 25, 24, 23, 18, 16, + 13, 12, 11, 10, 5, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + + 45, 45, 45, 45, 45, 45, 45 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int db_flex_debug; +int db_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 *dbtext; +#line 1 "src/db_lex.l" +#line 5 "src/db_lex.l" + +/* +C [a-zA-Z0-9������\\\*=$%�&/!\^\~;:.,\?\{\}\(\)\[\]\<\>\-\+\*\|\'\`] +*/ +/* +"\ "\\*=$%�&/!\^~;:.,?\{\}\(\)\[\]\<\>-+*\|\'\`] +typedef union { + char* s; + } YYSTYPE; +extern YYSTYPE yylval; + + +"/"({C}|{PC})+ { + return (TNAME); +} + +*/ + +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2005,2010,2013,2016 Rami Lehti,Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + + +#define YY_DECL int db_scan(void) + + +#define YYDEBUG 1 + +#include "aide.h" +#include "gen_list.h" +#include "conf_yacc.h" +#include +#include "report.h" +#include "commandconf.h" + +/* We need to define these here since we cannot include db.h*/ +#define DB_OLD (1<<0) +#define DB_WRITE (1<<1) +#define DB_NEW (1<<2) +#define NODE_ADDED (1<<4) +#define NODE_REMOVED (1<<5) +#define NODE_CHANGED (1<<6) + +long db_in_lineno=1; +long db_new_lineno=1; +long* db_lineno=&db_in_lineno; +YY_BUFFER_STATE db_stack[2]; + +int db_at_hand=0; + +#define YY_INPUT(buf,result,max_size) \ + if( ((result=db_input_wrapper(buf,max_size,db_at_hand)) == 0) \ + && ferror(dbin) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); + + + + +#line 597 "src/db_lex.c" + +#define INITIAL 0 +#define MDVALHUNT 1 + +#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 dblex_destroy (void ); + +int dbget_debug (void ); + +void dbset_debug (int debug_flag ); + +YY_EXTRA_TYPE dbget_extra (void ); + +void dbset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *dbget_in (void ); + +void dbset_in (FILE * _in_str ); + +FILE *dbget_out (void ); + +void dbset_out (FILE * _out_str ); + +yy_size_t dbget_leng (void ); + +char *dbget_text (void ); + +int dbget_lineno (void ); + +void dbset_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 dbwrap (void ); +#else +extern int dbwrap (void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst 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( dbtext, dbleng, 1, dbout )) {} } 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 = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( dbin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( dbin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, dbin))==0 && ferror(dbin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(dbin); \ + } \ + }\ +\ + +#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 dblex (void); + +#define YY_DECL int dblex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after dbtext and dbleng + * 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 \ + if ( dbleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (dbtext[dbleng - 1] == '\n'); \ + 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 ( ! dbin ) + dbin = stdin; + + if ( ! dbout ) + dbout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + dbensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + db_create_buffer(dbin,YY_BUF_SIZE ); + } + + db_load_buffer_state( ); + } + + { +#line 85 "src/db_lex.l" + + +#line 820 "src/db_lex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of dbtext. */ + *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_current_state += YY_AT_BOL(); +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 >= 46 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 86 ); + +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 87 "src/db_lex.l" +{ + return (TGZIPHEADER); +} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 91 "src/db_lex.l" +{ + return (TDBSPEC); +} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 95 "src/db_lex.l" +{ + return (TBEGIN_DB); +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 99 "src/db_lex.l" +{ + BEGIN MDVALHUNT; + return (TEND_DB); +} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 104 "src/db_lex.l" +{ + BEGIN 0; + return (TSTRING); +} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 109 "src/db_lex.l" +{ + return (TEND_DBNOMD); +} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 113 "src/db_lex.l" +{ + return (TUNKNOWN); +} + YY_BREAK +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +#line 117 "src/db_lex.l" +{ + (*db_lineno)++; +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 121 "src/db_lex.l" +{ + + error(230," %s \n",dbtext); + + return (TID); +} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 128 "src/db_lex.l" +{} + YY_BREAK +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 130 "src/db_lex.l" +{ + (*db_lineno)++; + return (TNEWLINE); +} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 135 "src/db_lex.l" +{ + return (TERROR); +} + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(MDVALHUNT): +#line 139 "src/db_lex.l" +{ + return (TEOF); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 144 "src/db_lex.l" +ECHO; + YY_BREAK +#line 980 "src/db_lex.c" + + 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 dbin at a new source and called + * dblex(). 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 = dbin; + 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 ( dbwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * dbtext, 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 dblex */ + +/* 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); + yy_size_t 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 = (yy_size_t) ((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 + { + yy_size_t 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 ) + { + yy_size_t 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. */ + dbrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + 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; + dbrestart(dbin ); + } + + 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 ((int) ((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 *) dbrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (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); + yy_current_state += YY_AT_BOL(); + + 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 >= 46 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 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 >= 46 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 45); + + 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 */ + yy_size_t offset = (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. */ + dbrestart(dbin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( dbwrap( ) ) + return EOF; + + 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 dbtext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + 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 dbrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + dbensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + db_create_buffer(dbin,YY_BUF_SIZE ); + } + + db_init_buffer(YY_CURRENT_BUFFER,input_file ); + db_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void db_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * dbpop_buffer_state(); + * dbpush_buffer_state(new_buffer); + */ + dbensure_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; + db_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (dbwrap()) processing, but the only time this flag + * is looked at is after dbwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void db_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; + dbin = 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 db_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) dballoc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in db_create_buffer()" ); + + b->yy_buf_size = (yy_size_t)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 *) dballoc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in db_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + db_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with db_create_buffer() + * + */ + void db_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 ) + dbfree((void *) b->yy_ch_buf ); + + dbfree((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a dbrestart() or at EOF. + */ + static void db_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + db_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then db_init_buffer was _probably_ + * called from dbrestart() 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 db_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 ) + db_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 dbpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + dbensure_buffer_stack(); + + /* This block is copied from db_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 db_switch_to_buffer. */ + db_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 dbpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + db_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + db_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 dbensure_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**)dballoc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dbensure_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**)dbrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in dbensure_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 db_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 0; + + b = (YY_BUFFER_STATE) dballoc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in db_scan_buffer()" ); + + b->yy_buf_size = 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 = 0; + 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; + + db_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to dblex() 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 + * db_scan_bytes() instead. + */ +YY_BUFFER_STATE db_scan_string (yyconst char * yystr ) +{ + + return db_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to dblex() 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 db_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) dballoc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in db_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 = db_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in db_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 yy_fatal_error (yyconst char* msg ) +{ + (void) 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 dbtext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + dbtext[dbleng] = (yy_hold_char); \ + (yy_c_buf_p) = dbtext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + dbleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int dbget_lineno (void) +{ + + return dblineno; +} + +/** Get the input stream. + * + */ +FILE *dbget_in (void) +{ + return dbin; +} + +/** Get the output stream. + * + */ +FILE *dbget_out (void) +{ + return dbout; +} + +/** Get the length of the current token. + * + */ +yy_size_t dbget_leng (void) +{ + return dbleng; +} + +/** Get the current token. + * + */ + +char *dbget_text (void) +{ + return dbtext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void dbset_lineno (int _line_number ) +{ + + dblineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see db_switch_to_buffer + */ +void dbset_in (FILE * _in_str ) +{ + dbin = _in_str ; +} + +void dbset_out (FILE * _out_str ) +{ + dbout = _out_str ; +} + +int dbget_debug (void) +{ + return db_flex_debug; +} + +void dbset_debug (int _bdebug ) +{ + db_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from dblex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + dbin = stdin; + dbout = stdout; +#else + dbin = (FILE *) 0; + dbout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * dblex_init() + */ + return 0; +} + +/* dblex_destroy is for both reentrant and non-reentrant scanners. */ +int dblex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + db_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + dbpop_buffer_state(); + } + + /* Destroy the stack itself. */ + dbfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * dblex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst 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 (yyconst char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *dballoc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *dbrealloc (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 (void *) realloc( (char *) ptr, size ); +} + +void dbfree (void * ptr ) +{ + free( (char *) ptr ); /* see dbrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 144 "src/db_lex.l" + + + +int dbwrap(){ + return 1; +} + +void db_buff(int db, FILE* f) +{ + int stack_pointer=0; + + switch(db) { + case DB_OLD: { + stack_pointer=0; + db_at_hand=DB_OLD; + break; + } + case DB_NEW: { + stack_pointer=1; + db_at_hand=DB_NEW; + break; + } + } + + if(f!=NULL){ + db_stack[stack_pointer]=db_create_buffer(f,YY_BUF_SIZE ); + } + db_switch_to_buffer(db_stack[stack_pointer]); + +} + diff --git a/src/db_lex.l b/src/db_lex.l new file mode 100644 index 0000000..5c15db1 --- /dev/null +++ b/src/db_lex.l @@ -0,0 +1,172 @@ +C [%!$&\'\(\)\*\+,\-./0-9;=?A-Za-z_] +L [a-zA-Z������0-9_] + +%{ + +/* +C [a-zA-Z0-9������\\\*=$%�&/!\^\~;:.,\?\{\}\(\)\[\]\<\>\-\+\*\|\'\`] +*/ +/* +"\ "\\*=$%�&/!\^~;:.,?\{\}\(\)\[\]\<\>-+*\|\'\`] +typedef union { + char* s; + } YYSTYPE; +extern YYSTYPE yylval; + + +"/"({C}|{PC})+ { + return (TNAME); +} + +*/ + +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2005,2010,2013,2016 Rami Lehti,Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 + */ + + +#define YY_DECL int db_scan(void) + + +#define YYDEBUG 1 + +#include "aide.h" +#include "gen_list.h" +#include "conf_yacc.h" +#include +#include "report.h" +#include "commandconf.h" + +/* We need to define these here since we cannot include db.h*/ +#define DB_OLD (1<<0) +#define DB_WRITE (1<<1) +#define DB_NEW (1<<2) +#define NODE_ADDED (1<<4) +#define NODE_REMOVED (1<<5) +#define NODE_CHANGED (1<<6) + +long db_in_lineno=1; +long db_new_lineno=1; +long* db_lineno=&db_in_lineno; +YY_BUFFER_STATE db_stack[2]; + +int db_at_hand=0; + +#define YY_INPUT(buf,result,max_size) \ + if( ((result=db_input_wrapper(buf,max_size,db_at_hand)) == 0) \ + && ferror(yyin) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); + + + +%} + +%option nounput + +%Start MDVALHUNT + +%% + +^"\037\213" { + return (TGZIPHEADER); +} + +"@@db_spec" { + return (TDBSPEC); +} + +^"@@begin_db" { + return (TBEGIN_DB); +} + +^"@@end_db " { + BEGIN MDVALHUNT; + return (TEND_DB); +} + +({C})+ { + BEGIN 0; + return (TSTRING); +} + +^"@@end_db" { + return (TEND_DBNOMD); +} + +"@@"({L}+) { + return (TUNKNOWN); +} + +"#"[^\n]*"\n" { + (*db_lineno)++; +} + +({C})+ { + + error(230," %s \n",yytext); + + return (TID); +} + +[" "\t] {} + +"\n" { + (*db_lineno)++; + return (TNEWLINE); +} + +[^\n] { + return (TERROR); +} + +<> { + return (TEOF); + } + + +%% + +int dbwrap(){ + return 1; +} + +void db_buff(int db, FILE* f) +{ + int stack_pointer=0; + + switch(db) { + case DB_OLD: { + stack_pointer=0; + db_at_hand=DB_OLD; + break; + } + case DB_NEW: { + stack_pointer=1; + db_at_hand=DB_NEW; + break; + } + } + + if(f!=NULL){ + db_stack[stack_pointer]=yy_create_buffer( f, YY_BUF_SIZE ); + } + yy_switch_to_buffer(db_stack[stack_pointer]); + +} diff --git a/src/db_list.c b/src/db_list.c new file mode 100644 index 0000000..a9e6a90 --- /dev/null +++ b/src/db_list.c @@ -0,0 +1,51 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999,2000,2001,2002 Rami Lehti,Pablo Virolainen + * $Header$ + * + * 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 "db_list.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +void db_list_append(db_list*item) +{ + db_list* tmp_listp=NULL; + item->next=NULL; + item->prev=NULL; + item->head=NULL; + + if(db_list_head==NULL){ + db_list_head=item; + db_list_head->next=NULL; + db_list_head->prev=NULL; + db_list_head->head=db_list_head; + db_list_head->tail=db_list_head; + return; + } + else { + tmp_listp=db_list_head->tail; + tmp_listp->next=item; + tmp_listp->tail=item; + item->head=db_list_head; + item->tail=db_list_head; + db_list_head->tail=item; + return; + } +} + diff --git a/src/db_sql.c b/src/db_sql.c new file mode 100644 index 0000000..1545790 --- /dev/null +++ b/src/db_sql.c @@ -0,0 +1,577 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 2000-2002,2004-2006,2011 Rami Lehti, Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#ifdef WITH_PSQL + +#include +#include +#include +#include +#include +#include "base64.h" +#include "db.h" + +#include "db_sql.h" +#include "db_config.h" +#include "libpq-fe.h" +#include "report.h" + +#ifdef WITH_MHASH +#include +#endif + +char* db_get_sql(db_line*,db_config*); + +int _db_check_result(PGconn *conn, PGresult *res, char *query) +{ + int status = 0; + int ret = RETOK; + + + if (!res || ( (PQresultStatus(res) != PGRES_COMMAND_OK) && + (PQresultStatus(res) != PGRES_TUPLES_OK) )){ + ret = RETFAIL; + if (res!=NULL) { + error(0,"Sql error %s while doing %s\n", PQerrorMessage(conn), query); + } else { + error(0,"Sql error while doing %s.\n",query); + } + } else { + error(255,"Sql went ok.\n"); + status = 1; + } + + return status; +} + +int db_writespec_sql(db_config* conf){ + PGresult *res; + int i; + int table_exists; + char* s; + int ret = RETOK; + + s = (char*) malloc(sizeof(char)*1024); /* Hope 1023 bytes is + enough for string... + 390 + length of table + name should be enough. + */ + /* We have to ensure that the database table not exist */ + + /* check if the table exists already */ + sprintf(s, "SELECT * FROM pg_class WHERE relname = '%s'", + ((psql_data*)conf->db_out)->table); + res = PQexec(((psql_data*)conf->db_out)->conn, s); + if ( _db_check_result(((psql_data*)conf->db_out)->conn, res, s) == 0 ) { + ret = RETFAIL; + } + table_exists = PQntuples(res) == 1 ? 1 : 0; + PQclear(res); + + *s = '\0'; /* reset query string */ + + if (table_exists == 0) { + /* we need to create the table */ + + s = strcat(s, "CREATE TABLE "); + + s = strcat(s, ((psql_data*)conf->db_out)->table); + s = strcat(s, "("); + + for (i=0;idb_out_size;i++) { + if (i!=0) { + s = strcat(s, ","); + } + s = strcat(s, db_names[conf->db_out_order[i]]); + s = strcat(s, " "); + s = strcat(s, db_sql_types[conf->db_out_order[i]]); + } + s = strcat(s,");"); + + error(255,"SQL:%s\n",s); + + res = PQexec(((psql_data*)conf->db_out)->conn,s); + + if (_db_check_result(((psql_data*)conf->db_out)->conn, res, s) == 0) { + ret = RETFAIL; + } + + PQclear(res); + } + + free(s); /* Just say no to memoryleaks. */ + + return ret; + + /* FIXME!! No error checkin may be broken. Fix malloc also */ +} + +int db_writeline_sql(db_line* line,db_config* conf){ + + PGresult *res; + int i; + int ret=RETOK; + char* s=db_get_sql(line,conf) ; + + if (s==NULL) { + return RETFAIL; + } + + error(255,"SQL:%s",s); + + res = PQexec(((psql_data*)conf->db_out)->conn,s); + if ( _db_check_result(((psql_data*)conf->db_out)->conn, res, s) == 0 ) { + ret = RETFAIL; + } + PQclear(res); + + free(s); + + return ret; +} + +void db_readline_sql_int(int* d,int db,int i, db_config* conf) +{ + FILE** db_filep=NULL; + + switch (db) { + case DB_OLD: { + db_filep=&(conf->db_in); + break; + } + case DB_NEW: { + db_filep=&(conf->db_new); + break; + } + } + + if (((psql_data*)(*db_filep))->des[i]!=-1) { + *d=(int)PQgetvalue(((psql_data*)(*db_filep))->res, + ((psql_data*)(*db_filep))->curread, + ((psql_data*)(*db_filep))->des[i]); + } else { + *d=0; + } + error(254,"sql_readline_sql_int %s got %i\n",db_names[i],*d); + +} + +void db_readline_sql_char(void** d,int db,const int i, db_config* conf) +{ + + volatile int cr,des; + psql_data* data; + FILE** db_filep=NULL; + + switch (db) { + case DB_OLD: { + db_filep=&(conf->db_in); + break; + } + case DB_NEW: { + db_filep=&(conf->db_new); + break; + } + } + + data=((psql_data*)(*db_filep)); + + cr=data->curread; + des=data->des[i]; + if (des!=-1) { + volatile char* s=NULL; + + s = (char*)PQgetvalue(data->res,cr,des); + if (s!=NULL) { + *d=(void*)strdup((char*)s); + } else { + *d=NULL; + } + error(254,"sql_readline_sql_char %i,%i %s got %s\n",cr,des,db_names[i],*d); + } else { + *d=NULL; + error(254,"sql_readline_sql_char %i,%i %s got NULL\n",cr,des,db_names[i]); + } + +} + +void db_readline_sql_byte(void** d,int db,int i, db_config* conf) { + + db_readline_sql_char(d,db,i, conf); + + if (*d!=NULL) { + *((byte*)d)=base64tobyte(*d,strlen(*d)); + } + +} + +void db_readline_sql_time(void** d,int db,int i, db_config* conf) { + + db_readline_sql_char(d,db,i, conf); + + if (*d!=NULL) { + *((time_t*)d)=base64totime_t(*d); + } + +} + +db_line* db_readline_sql(int db, db_config* conf) { + + volatile db_line* rline; + int i; + url_t* db_url=NULL; + FILE** db_filep=NULL; + int* db_osize=0; + DB_FIELD** db_order=NULL; + + switch (db) { + case DB_OLD: { + db_url=conf->db_in_url; + db_filep=&(conf->db_in); + db_osize=&(conf->db_in_size); + db_order=&(conf->db_in_order); + break; + } + case DB_NEW: { + db_url=conf->db_new_url; + db_filep=&(conf->db_new); + db_osize=&(conf->db_new_size); + db_order=&(conf->db_new_order); + break; + } + } + + + if (((psql_data*)(*db_filep))->curread>= + ((psql_data*)(*db_filep))->maxread) { + error(255,"Everything read from SQL\n"); + return NULL; + } + rline=(db_line*)malloc(1*sizeof(db_line)); + + db_readline_sql_byte((void*)&(rline->md5),db,(int)db_md5, conf); + db_readline_sql_byte((void*)&(rline->sha1),db,db_sha1, conf); + db_readline_sql_byte((void*)&(rline->rmd160),db,db_rmd160, conf); + db_readline_sql_byte((void*)&(rline->tiger),db,db_tiger, conf); +#ifdef WITH_MHASH + db_readline_sql_byte((void*)&(rline->crc32),db,db_crc32, conf); + db_readline_sql_byte((void*)&(rline->haval),db,db_haval, conf); + db_readline_sql_byte((void*)&(rline->gost),db,db_gost, conf); +#endif + db_readline_sql_char((void*)&(rline->fullpath),db,db_filename, conf); + rline->filename=rline->fullpath; + db_readline_sql_char((void*)&(rline->linkname),db,db_linkname, conf); + + db_readline_sql_int((void*)&(rline->perm),db,db_perm, conf); + db_readline_sql_int((void*)&(rline->uid),db,db_uid, conf); + db_readline_sql_int((void*)&(rline->gid),db,db_gid, conf); + db_readline_sql_int((void*)&(rline->inode),db,db_inode, conf); + db_readline_sql_int((void*)&(rline->nlink),db,db_lnkcount, conf); + + db_readline_sql_int((void*)&(rline->size),db,*db_osize, conf); + db_readline_sql_int((void*)&(rline->bcount),db,db_bcount, conf); + db_readline_sql_int((void*)&(rline->attr),db,db_attr, conf); + + db_readline_sql_time((void*)&(rline->atime),db,db_atime, conf); + db_readline_sql_time((void*)&(rline->ctime),db,db_ctime, conf); + db_readline_sql_time((void*)&(rline->mtime),db,db_mtime, conf); +#ifdef WITH_ACL + rline->acl=NULL; +#endif + ((psql_data*)(*db_filep))->curread++; + + error(255,"filename %s\n",rline->filename); + + return rline; +} + + +void sql_writeint(int data,char *s,int i){ + char t[10]; + t[0]=0; + if (i!=0) { + s = strcat(s,","); + } + sprintf(t,"%i",data); + + strcat(s,t); + +} + +void sql_writeoct(int data,char *s,int i){ + char t[10]; + t[0]=0; + if (i!=0) { + s = strcat(s,","); + } + sprintf(t,"%lo",data); + + strcat(s,t); + +} + +void sql_write_time_base64(time_t data,char* s,int i){ + static char* ptr=NULL; + char* tmpstr=NULL; + int retval=0; + + if(i!=0){ + strcat(s,","); + } + + if(data==0){ + strcat(s,"''"); + return; + } + + + ptr=(char*)malloc(sizeof(char)*TIMEBUFSIZE); + if (ptr==NULL) { + error(0,"\nCannot allocate memory..\n"); + abort(); + } + + memset((void*)ptr,0,sizeof(char)*TIMEBUFSIZE); + + sprintf(ptr,"%li",data); + + + tmpstr=encode_base64(ptr,strlen(ptr)); + strcat(s,"'"); + strcat(s,tmpstr); + strcat(s,"'"); + + free(tmpstr); + free(ptr); + + return; + +} + +void sql_write_byte_base64(byte*data,size_t len,char* s,int i ) +{ + char* tmpstr=NULL; + int retval=0; + + tmpstr=encode_base64(data,len); + if(i){ + strcat(s,","); + } + + strcat(s,"'"); + + if(tmpstr){ + strcat(s,tmpstr); + free(tmpstr); + }else { + /* Do nothing.. */ + } + + strcat(s,"'"); + return; +} + + +char* db_get_sql(db_line* line,db_config* conf){ + + int i; + char* s=(char*) malloc(sizeof(char)*10240); /* FIXME .. */ + + if (s==NULL) { + error(0,"\nCannot allocate memory..\n"); + abort(); + } + + s[0]=0; + + /* Insertion was hardcoded into aide-table, now we will use the + provided name from the configfile */ + + s = strcat(s,"INSERT INTO "); + s = strcat(s, ((psql_data*)conf->db_out)->table); + s = strcat(s," values("); + + for(i=0;idb_out_size;i++){ + switch (conf->db_out_order[i]) { + case db_filename : { + char* tmp; + if ( i!=0 ) { + s = strcat(s,","); + } + strcat(s,"'"); + tmp=encode_string(line->filename); + s = strcat(s,tmp); + free(tmp); + strcat(s,"'"); + break; + } + case db_linkname : { + if ( i!=0 ) { + s = strcat(s,","); + } + strcat(s,"'"); + if (line->linkname != NULL) { + char* tmp; + tmp=encode_string(line->linkname); + s = strcat(s,tmp); + free(tmp); + } + strcat(s,"'"); + break; + } + case db_attr : { + sql_writeint(line->attr,s,i); + break; + } + case db_bcount : { + sql_writeint(line->bcount,s,i); + break; + } + + case db_mtime : { + sql_write_time_base64(line->mtime,s,i); + break; + } + case db_atime : { + sql_write_time_base64(line->atime,s,i); + break; + } + case db_ctime : { + sql_write_time_base64(line->ctime,s,i); + break; + } + case db_inode : { + sql_writeint(line->inode,s,i); + break; + } + case db_lnkcount : { + sql_writeint(line->nlink,s,i); + break; + } + case db_uid : { + sql_writeint(line->uid,s,i); + break; + } + case db_gid : { + sql_writeint(line->gid,s,i); + break; + } + case db_size : { + sql_writeint(line->size,s,i); + break; + } + case db_md5 : { + sql_write_byte_base64(line->md5, + gcry_md_get_algo_dlen(GCRY_MD_MD5),s,i); + break; + } + case db_sha1 : { + sql_write_byte_base64(line->sha1, + gcry_md_get_algo_dlen(GCRY_MD_SHA1),s,i); + break; + } + case db_rmd160 : { + sql_write_byte_base64(line->rmd160, + gcry_md_get_algo_dlen(GCRY_MD_RMD160), + s,i); + break; + } + case db_tiger : { + sql_write_byte_base64(line->tiger, + gcry_md_get_algo_dlen(GCRY_MD_TIGER), + s,i); + break; + } + case db_perm : { + sql_writeoct(line->perm,s,i); + break; + } +#ifdef WITH_MHASH + case db_crc32 : { + sql_write_byte_base64(line->crc32, + mhash_get_block_size(MHASH_CRC32), + s,i); + break; + } + case db_crc32b : { + sql_write_byte_base64(line->crc32b, + mhash_get_block_size(MHASH_CRC32B), + s,i); + break; + } + case db_haval : { + sql_write_byte_base64(line->haval, + mhash_get_block_size(MHASH_HAVAL256), + s,i); + break; + } + case db_gost : { + sql_write_byte_base64(line->gost , + mhash_get_block_size(MHASH_GOST), + s,i); + break; + } +#endif + case db_acl : { + error(0,"TODO db_acl write to db_sql.c"); + /* TODO */ + break; + } + case db_xattrs : { + error(0,"TODO db_xattrs write to db_sql.c"); + /* TODO */ + break; + } + case db_checkmask : { + sql_writeoct(line->attr,s,i); + break; + } + default : { + error(0,"Not implemented in sql_writeline_file %i\n", + conf->db_out_order[i]); + return NULL; + } + + } + + } + + strcat(s,");"); + + return s; +} + +int db_close_sql(void* db){ + + PQexec(((psql_data*)db)->conn,"commit"); + + PQfinish(((psql_data*)db)->conn); + + return RETOK; + +} + +#endif diff --git a/src/do_md.c b/src/do_md.c new file mode 100644 index 0000000..bc06e62 --- /dev/null +++ b/src/do_md.c @@ -0,0 +1,670 @@ +/* aide, Advanced Intrusion Detection Environment + * vi: ts=8 sw=8 + * + * Copyright (C) 1999-2002,2004-2006,2009-2011,2013 Rami Lehti, Pablo + * Virolainen, Mike Markley, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" + +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112L +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "md.h" + +#include "db_config.h" +#include "do_md.h" +#include "report.h" +#include "list.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + + +/* This define should be somewhere else */ +#define READ_BLOCK_SIZE 16777216 + +#ifdef WITH_MHASH +#include +#endif /* WITH_MHASH */ + +/* Redhat 5.0 needs this */ +#ifdef HAVE_MMAP +#ifndef MAP_FAILED +#define MAP_FAILED (-1) +#endif /* MAP_FAILED */ +#define MMAP_BLOCK_SIZE 16777216 +#endif /* HAVE_MMAP */ + +/* +#include +*/ + +#ifdef WITH_PRELINK +#include +#include + +/* + * Is file descriptor prelinked binary/library? + * Return: 1(yes) / 0(no) + * + */ +int is_prelinked(int fd) { + Elf *elf = NULL; + Elf_Scn *scn = NULL; + Elf_Data *data = NULL; + GElf_Ehdr ehdr; + GElf_Shdr shdr; + GElf_Dyn dyn; + int bingo; + + (void) elf_version(EV_CURRENT); + + if ((elf = elf_begin (fd, ELF_C_READ, NULL)) == NULL + || elf_kind(elf) != ELF_K_ELF + || gelf_getehdr(elf, &ehdr) == NULL + || !(ehdr.e_type == ET_DYN || ehdr.e_type == ET_EXEC)) + return 0; + + bingo = 0; + while (!bingo && (scn = elf_nextscn(elf, scn)) != NULL) { + (void) gelf_getshdr(scn, &shdr); + + if (shdr.sh_type != SHT_DYNAMIC) + continue; + + while (!bingo && (data = elf_getdata (scn, data)) != NULL) { + int maxndx = data->d_size / shdr.sh_entsize; + int ndx; + + for (ndx = 0; ndx < maxndx; ++ndx) { + (void) gelf_getdyn (data, ndx, &dyn); + if (!(dyn.d_tag == DT_GNU_PRELINKED || dyn.d_tag == DT_GNU_LIBLIST)) + continue; + bingo = 1; + break; + } + } + } + + return bingo; +} + +/* + * Open path via prelink -y, set fd + * Return: 0 failure / > 0 success + * + */ +pid_t open_prelinked(const char * path, int * fd) { + const char *cmd = PRELINK_PATH; + pid_t pid = 0; + int pipes[2]; + + pipes[0] = pipes[1] = -1; + if (pipe(pipes) < 0) + return 0; + pid = fork(); + switch (pid) { + case 0: + /* child */ + close(pipes[0]); + dup2(pipes[1], STDOUT_FILENO); + close(pipes[1]); + unsetenv("MALLOC_CHECK_"); + execl(cmd, cmd, "--verify", path, (char *) NULL); + exit(1); + break; + case -1: + close(pipes[0]); + close(pipes[1]); + return 0; + } + /* parent */ + close(pipes[1]); + *fd = pipes[0]; + return pid; +} + +#endif + +void free_hashes(db_line* dl){ + +#define free_hash(a) dl->a=NULL + + free_hash(md5); + free_hash(sha1); + free_hash(rmd160); + free_hash(tiger); +#ifdef WITH_MHASH + free_hash(crc32); + free_hash(haval); + free_hash(gost); + free_hash(crc32b); +#endif + free_hash(sha256); + free_hash(sha512); +} + +int stat_cmp(struct AIDE_STAT_TYPE* f1,struct AIDE_STAT_TYPE* f2) { + if (f1==NULL || f2==NULL) { + return RETFAIL; + } +#define stat_cmp_helper(n,n2) ((f1->n!=f2->n)*n2) + + return (stat_cmp_helper(st_ino,DB_INODE)| + stat_cmp_helper(st_mode,DB_PERM)| + stat_cmp_helper(st_nlink,DB_LNKCOUNT)| + stat_cmp_helper(st_size,DB_SIZE)| + stat_cmp_helper(st_mtime,DB_MTIME)| + stat_cmp_helper(st_ctime,DB_CTIME)| + stat_cmp_helper(st_blocks,DB_BCOUNT)| + stat_cmp_helper(st_blksize,DB_BSIZE)| + stat_cmp_helper(st_rdev,DB_RDEV)| + stat_cmp_helper(st_gid,DB_GID)| + stat_cmp_helper(st_uid,DB_UID)| + stat_cmp_helper(st_dev,DB_DEV)); +} + + +void no_hash(db_line* line); + +void calc_md(struct AIDE_STAT_TYPE* old_fs,db_line* line) { + /* + We stat after opening just to make sure that the file + from we are about to calculate the hash is the correct one, + and we don't read from a pipe :) + */ + struct AIDE_STAT_TYPE fs; + int sres=0; + int stat_diff,filedes; +#ifdef WITH_PRELINK + pid_t pid; +#endif + + error(255,"calc_md called\n"); +#ifdef _PARAMETER_CHECK_ + if (line==NULL) { + abort(); + } +#endif + +#ifdef HAVE_O_NOATIME + filedes=open(line->fullpath,O_RDONLY|O_NOATIME); + if(filedes<0) +#endif + filedes=open(line->fullpath,O_RDONLY); + + if (filedes==-1) { + char* er=strerror(errno); + if (er!=NULL) { + error(3,"do_md(): open() for %s failed: %s\n", + line->fullpath,er); + } else { + error(3,"do_md(): open() for %s failed: %i\n", + line->fullpath,errno); + } + /* + Nop. Cannot cal hashes. Mark it. + */ + no_hash(line); + return; + } + + sres=AIDE_FSTAT_FUNC(filedes,&fs); + if(!(line->attr&DB_RDEV)) + fs.st_rdev=0; + +#ifdef HAVE_POSIX_FADVISE + if (posix_fadvise(filedes,0,fs.st_size,POSIX_FADV_NOREUSE)!=0) { + error(255,"posix_fadvise error %s\n",strerror(errno)); + } else { + error(255,"posix_fadvise(%i,0,%li,POSIX_FADV_NOREUSE) ok\n",filedes,fs.st_size); + } +#endif + if ((stat_diff=stat_cmp(&fs,old_fs))==RETOK) { + /* + Now we have a 'valid' filehandle to read from a file. + */ + +#ifdef WITH_PRELINK + /* + * Let's take care of prelinked libraries/binaries + */ + pid=0; + if ( is_prelinked(filedes) ) { + close(filedes); + pid = open_prelinked(line->fullpath, &filedes); + if (pid == 0) { + error(0, "Error on starting prelink undo\n"); + return; + } + } +#endif + + off_t r_size=0; + off_t size=0; + char* buf; + + struct md_container mdc; + + mdc.todo_attr=line->attr; + + if (init_md(&mdc)==RETOK) { +#ifdef HAVE_MMAP +#ifdef WITH_PRELINK + if (pid == 0) { +#endif + off_t curpos=0; + + r_size=fs.st_size; + /* in mmap branch r_size is used as size remaining */ + while(r_size>0){ + if(r_sizefullpath,strerror(errno)); + close(filedes); + close_md(&mdc); + return; + } + conf->catch_mmap=1; + if (update_md(&mdc,buf,size)!=RETOK) { + error(0,"Message digest failed during update\n"); + close(filedes); + close_md(&mdc); + munmap(buf,size); + return; + } + munmap(buf,size); + conf->catch_mmap=0; + } + /* we have used MMAP, let's return */ + close_md(&mdc); + md2line(&mdc,line); + close(filedes); + return; +#ifdef WITH_PRELINK + } +#endif +#endif /* not HAVE_MMAP */ + buf=malloc(READ_BLOCK_SIZE); +#if READ_BLOCK_SIZE>SSIZE_MAX +#error "READ_BLOCK_SIZE" is too large. Max value is SSIZE_MAX, and current is READ_BLOCK_SIZE +#endif + while ((size=TEMP_FAILURE_RETRY(read(filedes,buf,READ_BLOCK_SIZE)))>0) { + if (update_md(&mdc,buf,size)!=RETOK) { + error(0,"Message digest failed during update\n"); + close(filedes); + close_md(&mdc); + return; + } + r_size+=size; + } + +#ifdef WITH_PRELINK + if (pid) { + int status; + (void) waitpid(pid, &status, 0); + if (!WIFEXITED(status) || WEXITSTATUS(status)) { + error(0, "Error on exit of prelink child process\n"); + close(filedes); + close_md(&mdc); + return; + } + } +#endif + free(buf); + close_md(&mdc); + md2line(&mdc,line); + + } else { + error(3,"Message digest initialization failed.\n"); + no_hash(line); + close(filedes); + return; + } + } else { + unsigned i; + /* + Something just wasn't correct, so no hash calculated. + */ + + error(5,"Entry %s was changed so that hash cannot be calculated for it\n" + ,line->fullpath); + + for(i=0;iinode=fs->st_ino; + + if(DB_UID&line->attr) { + line->uid=fs->st_uid; + }else { + line->uid=0; + } + + if(DB_GID&line->attr){ + line->gid=fs->st_gid; + }else{ + line->gid=0; + } + + line->perm=fs->st_mode; + + if(DB_SIZE&line->attr||DB_SIZEG&line->attr){ + line->size=fs->st_size; + }else{ + line->size=0; + } + + if(DB_LNKCOUNT&line->attr){ + line->nlink=fs->st_nlink; + }else { + line->nlink=0; + } + + if(DB_MTIME&line->attr){ + line->mtime=fs->st_mtime; + }else{ + line->mtime=0; + } + + if(DB_CTIME&line->attr){ + line->ctime=fs->st_ctime; + }else{ + line->ctime=0; + } + + if(DB_ATIME&line->attr){ + line->atime=fs->st_atime; + }else{ + line->atime=0; + } + + if(DB_BCOUNT&line->attr){ + line->bcount=fs->st_blocks; + } else { + line->bcount=0; + } + +} + +#ifdef WITH_ACL +void acl2line(db_line* line) { + acl_type *ret = NULL; + +#ifdef WITH_POSIX_ACL + if(DB_ACL&line->attr) { + acl_t acl_a; + acl_t acl_d; + char *tmp = NULL; + + acl_a = acl_get_file(line->fullpath, ACL_TYPE_ACCESS); + acl_d = acl_get_file(line->fullpath, ACL_TYPE_DEFAULT); + if ((acl_a == NULL) && (errno == ENOTSUP)) { + line->attr&=(~DB_ACL); + return; + } + if (acl_a == NULL) + error(0, "Tried to read access ACL on %s but failed with: %s\n", + line->fullpath, strerror(errno)); + if ((acl_d == NULL) && (errno != EACCES)) /* ignore DEFAULT on files */ + { + acl_free(acl_a); + error(0, "Tried to read default ACL on %s but failed with: %s\n", + line->fullpath, strerror(errno)); + } + + /* assume memory allocs work, like rest of AIDE code... */ + ret = malloc(sizeof(acl_type)); + + /* use tmp, so free() can be called instead of acl_free() */ + tmp = acl_to_text(acl_a, NULL); + if (!tmp || !*tmp) + ret->acl_a = NULL; + else + ret->acl_a = strdup(tmp); + acl_free(tmp); + + if (!acl_d) + ret->acl_d = NULL; + else + { + tmp = acl_to_text(acl_d, NULL); + if (!tmp || !*tmp) + ret->acl_d = NULL; + else + ret->acl_d = strdup(tmp); + acl_free(tmp); + } + + acl_free(acl_a); + acl_free(acl_d); + } + line->acl = ret; +#endif +#ifdef WITH_SUN_ACL + if(DB_ACL&line->attr) { /* There might be a bug here. */ + int res; + line->acl=malloc(sizeof(acl_type)); + line->acl->entries=acl(line->fullpath,GETACLCNT,0,NULL); + if (line->acl->entries==-1) { + char* er=strerror(errno); + line->acl->entries=0; + if (er==NULL) { + error(0,"ACL query failed for %s. strerror failed for %i\n",line->fullpath,errno); + } else { + error(0,"ACL query failed for %s:%s\n",line->fullpath,er); + } + } else { + line->acl->acl=malloc(sizeof(aclent_t)*line->acl->entries); + res=acl(line->fullpath,GETACL,line->acl->entries,line->acl->acl); + if (res==-1) { + error(0,"ACL error %s\n",strerror(errno)); + } else { + if (res!=line->acl->entries) { + error(0,"Tried to read %i acl but got %i\n",line->acl->entries,res); + } + } + } + }else{ + line->acl=NULL; + } +#endif +} +#endif + +#ifdef WITH_XATTR +static xattrs_type *xattr_new(void) { + xattrs_type *ret = NULL; + + ret = malloc(sizeof(xattrs_type)); + ret->num = 0; + ret->sz = 2; + ret->ents = malloc(sizeof(xattr_node) * ret->sz); + + return (ret); +} + +static void *xzmemdup(const void *ptr, size_t len) { + /* always keeps a 0 at the end... */ + void *ret = NULL; + + ret = malloc(len+1); + memcpy(ret, ptr, len); + ((char*)ret)[len] = 0; + + return (ret); +} + +static void xattr_add(xattrs_type *xattrs, const char *key, const char + *val, size_t vsz) { + if (xattrs->num >= xattrs->sz) { + xattrs->sz <<= 1; + xattrs->ents = realloc(xattrs->ents, sizeof(xattr_node) * xattrs->sz); + } + + xattrs->ents[xattrs->num].key = strdup(key); + xattrs->ents[xattrs->num].val = xzmemdup(val, vsz); + xattrs->ents[xattrs->num].vsz = vsz; + + xattrs->num += 1; +} + +void xattrs2line(db_line *line) { + /* get all generic user xattrs. */ + xattrs_type *xattrs = NULL; + static ssize_t xsz = 1024; + static char *xatrs = NULL; + ssize_t xret = -1; + + if (!(DB_XATTRS&line->attr)) + return; + + /* assume memory allocs work, like rest of AIDE code... */ + if (!xatrs) xatrs = malloc(xsz); + + while (((xret = llistxattr(line->fullpath, xatrs, xsz)) == -1) && (errno == ERANGE)) { + xsz <<= 1; + xatrs = realloc(xatrs, xsz); + } + + if ((xret == -1) && ((errno == ENOSYS) || (errno == ENOTSUP))) { + line->attr&=(~DB_XATTRS); + } else if (xret == -1) { + error(0, "listxattrs failed for %s:%s\n", line->fullpath, strerror(errno)); + } else if (xret) { + const char *attr = xatrs; + static ssize_t asz = 1024; + static char *val = NULL; + + if (!val) val = malloc(asz); + + xattrs = xattr_new(); + + while (xret > 0) { + size_t len = strlen(attr); + ssize_t aret = 0; + + if (strncmp(attr, "user.", strlen("user.")) && + strncmp(attr, "root.", strlen("root."))) + goto next_attr; /* only store normal xattrs, and SELinux */ + + while (((aret = getxattr(line->fullpath, attr, val, asz)) == + -1) && (errno == ERANGE)) { + asz <<= 1; + val = realloc (val, asz); + } + + if (aret != -1) + xattr_add(xattrs, attr, val, aret); + else if (errno != ENOATTR) + error(0, "getxattr failed for %s:%s\n", line->fullpath, strerror(errno)); + +next_attr: + attr += len + 1; + xret -= len + 1; + } + } + + line->xattrs = xattrs; +} +#endif + +#ifdef WITH_SELINUX +void selinux2line(db_line *line) { + char *cntx = NULL; + + if (!(DB_SELINUX&line->attr)) + return; + + if (lgetfilecon_raw(line->fullpath, &cntx) == -1) { + line->attr&=(~DB_SELINUX); + if ((errno != ENOATTR) && (errno != EOPNOTSUPP)) + error(0, "lgetfilecon_raw failed for %s:%s\n", line->fullpath, strerror(errno)); + return; + } + + line->cntx = strdup(cntx); + + freecon(cntx); +} +#endif + +#ifdef WITH_E2FSATTRS +void e2fsattrs2line(db_line* line) { + unsigned long flags; + if (DB_E2FSATTRS&line->attr) { + if (fgetflags(line->fullpath, &flags) == 0) { + line->e2fsattrs=flags; + } else { + line->attr&=(~DB_E2FSATTRS); + line->e2fsattrs=0; + } + } else { + line->e2fsattrs=0; + } +} +#endif + +void no_hash(db_line* line) { + line->attr&=~DB_HASHES; +} + diff --git a/src/error.c b/src/error.c new file mode 100644 index 0000000..21533d2 --- /dev/null +++ b/src/error.c @@ -0,0 +1,246 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2006 Rami Lehti, Pablo Virolainen, Mike + * Markley, Richard van den Berg + * $Header$ + * + * 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 "aide.h" + +#include +#include +#include +#include + +#ifdef HAVE_SYSLOG +#include +#endif + +#include "report.h" +#include "list.h" +#include "be.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ +#include "util.h" + +int cmp_url(url_t* url1,url_t* url2){ + + return ((url1->type==url2->type)&&(strcmp(url1->value,url2->value)==0)); + +} + +int error_init(url_t* url,int initial) +{ + list* r=NULL; + FILE* fh=NULL; + int sfac; + + if (url->type==url_database) { + conf->report_db++; + return RETOK; + } + + if(initial==1){ + if (url->type==url_syslog) { + conf->report_syslog++; +#ifdef HAVE_SYSLOG + conf->initial_report_url=url; + conf->initial_report_fd=NULL; + sfac=syslog_facility_lookup(url->value); + openlog(AIDE_IDENT,AIDE_LOGOPT, sfac); + + return RETOK; +#endif +#ifndef HAVE_SYSLOG + error(0,_("This binary has no syslog support\n")); + exit(INVALID_ARGUMENT_ERROR); +#endif + } + fh=be_init(0,url,0); + if(fh!=NULL){ + conf->initial_report_fd=fh; + conf->initial_report_url=url; + return RETOK; + } + error(0,_("Cannot open %s for writing\n"),url->value); + exit(INVALID_ARGUMENT_ERROR); + } + + if(conf->verbose_level>=200){ + error(5,_("WARNING: Debug output enabled\n")); + } + + for(r=conf->report_url;r;r=r->next){ + + if (cmp_url((url_t*)r->data,url)) { + + error(5,_("WARNING: Already have report output %s\n"),url->value); + return RETOK; + } + + } + + + if (url->type==url_syslog) { + conf->report_syslog++; +#ifdef HAVE_SYSLOG + /* If you add support for facility changing in config + consider multiple calls of openlog. + This openlog MUST NOT mess up initial errorsto openlog. + RvdB 22/1/2006: the 2 openlog calls where the same before my + change, and they are still the same, I assume I did not brake anything + */ + sfac=syslog_facility_lookup(url->value); + if(conf->report_syslog<2) + openlog(AIDE_IDENT,AIDE_LOGOPT, sfac); + + return RETOK; +#endif +#ifndef HAVE_SYSLOG + error(0,_("This binary has no syslog support\n")); + return RETFAIL; +#endif + } + + fh=be_init(0,url,0); + if(fh!=NULL) { + conf->report_fd=list_append(conf->report_fd,(void*)fh); + conf->report_url=list_append(conf->report_url,(void*)url); + return RETOK; + } + + error(0,_("Cannot open %s for writing\n"),url->value); + + return RETFAIL; + +} + +void error(int errorlevel,char* error_msg,...) +{ + va_list ap; + int retval=0; + list* r=NULL; + + if(conf->verbose_level==-1){ + if(5verbose_leveluse_initial_errorsto){ + /* We are still using the initial errorsto */ + va_start(ap, error_msg); + if(conf->initial_report_url==NULL){ + /* Error called before error_init(url,1) + This most likely means that parsing compiled in initial + report url failed. + */ + vfprintf(stderr,error_msg,ap); + va_end(ap); + fprintf(stderr, + "Initial report url broken. Reconfigure and recompile.\n"); + exit(INVALID_ARGUMENT_ERROR); + } +#ifdef HAVE_SYSLOG + if(conf->initial_report_url->type==url_syslog){ +#ifdef HAVE_VSYSLOG + vsyslog(SYSLOG_PRIORITY,error_msg,ap); +#else + char buf[1024]; + vsnprintf(buf,1024,error_msg,ap); + syslog(SYSLOG_PRIORITY,"%s",buf); +#endif + va_end(ap); + return; + } +#endif + vfprintf(conf->initial_report_fd,error_msg,ap); + va_end(ap); + return; + } + +#ifdef HAVE_SYSLOG + if (conf->report_syslog!=0) { +#ifdef HAVE_VSYSLOG + va_start(ap,error_msg); + vsyslog(SYSLOG_PRIORITY,error_msg,ap); + va_end(ap); +#else + char buf[1024]; + va_start(ap,error_msg); + vsnprintf(buf,1024,error_msg,ap); + va_end(ap); + syslog(SYSLOG_PRIORITY,"%s",buf); +#endif + } +#endif + + +#ifdef WITH_DBERROR + if (conf->report_db!=0 && ( conf->db_out!=NULL +#ifdef WITH_ZLIB + || conf->db_gzout +#endif + )) { + db_line line; + int len; + memset(&line,0,sizeof(db_line)); + line.filename=(char*)malloc(3); + if (line.filename!=NULL) { + va_start(ap,error_msg); + len=vsnprintf(line.filename,2,error_msg,ap); + va_end(ap); + free(line.filename); + line.filename=malloc(len+2); + line.filename[0]='#'; + if (line.filename!=NULL) { + line.attr=DB_FILENAME; + va_start(ap,error_msg); + len=vsnprintf(line.filename+1,len+1,error_msg,ap); + va_end(ap); + db_writeline(&line,conf); + free(line.filename); + } + } + } +#endif + + for(r=conf->report_fd;r;r=r->next){ + va_start(ap, error_msg); + retval=vfprintf((FILE*)r->data, error_msg,ap); + va_end(ap); + if(retval==0){ + va_start(ap, error_msg); + retval=vfprintf((FILE*)r->data, error_msg,ap); + va_end(ap); + if(retval==0){ + exit(ERROR_WRITING_ERROR); + } + } + } + + return; +} + +const char* aide_key_0=CONFHMACKEY_00; +const char* db_key_0=DBHMACKEY_00; diff --git a/src/fopen.c b/src/fopen.c new file mode 100644 index 0000000..0f57048 --- /dev/null +++ b/src/fopen.c @@ -0,0 +1,397 @@ +/***************************************************************************** + * + * This example source code introduces a c library buffered I/O interface to + * URL reads it supports fopen(), fread(), fgets(), feof(), fclose(), + * rewind(). Supported functions have identical prototypes to their normal c + * lib namesakes and are preceaded by url_ . + * + * Using this code you can replace your program's fopen() with url_fopen() + * and fread() with url_fread() and it become possible to read remote streams + * instead of (only) local files. Local files (ie those that can be directly + * fopened) will drop back to using the underlying clib implementations + * + * See the main() function at the bottom that shows an app that retrives from a + * specified url using fgets() and fread() and saves as two output files. + * + * Copyright (c) 2003 Simtec Electronics + * + * Re-implemented by Vincent Sanders with extensive + * reference to original curl example code + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This example requires libcurl 7.9.7 or later. + * + * Modified for aide by Hannes von Haugwitz + * based on modifications of previous version by Pablo Virolainen + * (pablo@ipi.fi): + * 2013-05-14: - moved declarations to 'include/fopen.h' + * - removed (unneeded) main method + */ + +#include "fopen.h" + +/* we use a global one for convenience */ +CURLM *multi_handle; + +/* curl calls this routine to get more data */ +static size_t write_callback(char *buffer, + size_t size, + size_t nitems, + void *userp) +{ + char *newbuff; + size_t rembuff; + + URL_FILE *url = (URL_FILE *)userp; + size *= nitems; + + rembuff=url->buffer_len - url->buffer_pos; /* remaining space in buffer */ + + if(size > rembuff) { + /* not enough space in buffer */ + newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff)); + if(newbuff==NULL) { + fprintf(stderr,"callback buffer grow failed\n"); + size=rembuff; + } + else { + /* realloc suceeded increase buffer size*/ + url->buffer_len+=size - rembuff; + url->buffer=newbuff; + } + } + + memcpy(&url->buffer[url->buffer_pos], buffer, size); + url->buffer_pos += size; + + return size; +} + +/* use to attempt to fill the read buffer up to requested number of bytes */ +static int fill_buffer(URL_FILE *file, size_t want) +{ + fd_set fdread; + fd_set fdwrite; + fd_set fdexcep; + struct timeval timeout; + int rc; + + /* only attempt to fill buffer if transactions still running and buffer + * doesnt exceed required size already + */ + if((!file->still_running) || (file->buffer_pos > want)) + return 0; + + /* attempt to fill buffer */ + do { + int maxfd = -1; + long curl_timeo = -1; + + FD_ZERO(&fdread); + FD_ZERO(&fdwrite); + FD_ZERO(&fdexcep); + + /* set a suitable timeout to fail on */ + timeout.tv_sec = 60; /* 1 minute */ + timeout.tv_usec = 0; + + curl_multi_timeout(multi_handle, &curl_timeo); + if(curl_timeo >= 0) { + timeout.tv_sec = curl_timeo / 1000; + if(timeout.tv_sec > 1) + timeout.tv_sec = 1; + else + timeout.tv_usec = (curl_timeo % 1000) * 1000; + } + + /* get file descriptors from the transfers */ + curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); + + /* In a real-world program you OF COURSE check the return code of the + function calls. On success, the value of maxfd is guaranteed to be + greater or equal than -1. We call select(maxfd + 1, ...), specially + in case of (maxfd == -1), we call select(0, ...), which is basically + equal to sleep. */ + + rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); + + switch(rc) { + case -1: + /* select error */ + break; + + case 0: + default: + /* timeout or readable/writable sockets */ + curl_multi_perform(multi_handle, &file->still_running); + break; + } + } while(file->still_running && (file->buffer_pos < want)); + return 1; +} + +/* use to remove want bytes from the front of a files buffer */ +static int use_buffer(URL_FILE *file,int want) +{ + /* sort out buffer */ + if((file->buffer_pos - want) <=0) { + /* ditch buffer - write will recreate */ + if(file->buffer) + free(file->buffer); + + file->buffer=NULL; + file->buffer_pos=0; + file->buffer_len=0; + } + else { + /* move rest down make it available for later */ + memmove(file->buffer, + &file->buffer[want], + (file->buffer_pos - want)); + + file->buffer_pos -= want; + } + return 0; +} + +URL_FILE *url_fopen(const char *url,const char *operation) +{ + /* this code could check for URLs or types in the 'url' and + basicly use the real fopen() for standard files */ + + URL_FILE *file; + (void)operation; + + file = malloc(sizeof(URL_FILE)); + if(!file) + return NULL; + + memset(file, 0, sizeof(URL_FILE)); + + if((file->handle.file=fopen(url,operation))) + file->type = CFTYPE_FILE; /* marked as URL */ + + else { + file->type = CFTYPE_CURL; /* marked as URL */ + file->handle.curl = curl_easy_init(); + + curl_easy_setopt(file->handle.curl, CURLOPT_URL, url); + curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file); + curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L); + curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback); + + if(!multi_handle) + multi_handle = curl_multi_init(); + + curl_multi_add_handle(multi_handle, file->handle.curl); + + /* lets start the fetch */ + curl_multi_perform(multi_handle, &file->still_running); + + if((file->buffer_pos == 0) && (!file->still_running)) { + /* if still_running is 0 now, we should return NULL */ + + /* make sure the easy handle is not in the multi handle anymore */ + curl_multi_remove_handle(multi_handle, file->handle.curl); + + /* cleanup */ + curl_easy_cleanup(file->handle.curl); + + free(file); + + file = NULL; + } + } + return file; +} + +int url_fclose(URL_FILE *file) +{ + int ret=0;/* default is good return */ + + switch(file->type) { + case CFTYPE_FILE: + ret=fclose(file->handle.file); /* passthrough */ + break; + + case CFTYPE_CURL: + /* make sure the easy handle is not in the multi handle anymore */ + curl_multi_remove_handle(multi_handle, file->handle.curl); + + /* cleanup */ + curl_easy_cleanup(file->handle.curl); + break; + + default: /* unknown or supported type - oh dear */ + ret=EOF; + errno=EBADF; + break; + } + + if(file->buffer) + free(file->buffer);/* free any allocated buffer space */ + + free(file); + + return ret; +} + +int url_feof(URL_FILE *file) +{ + int ret=0; + + switch(file->type) { + case CFTYPE_FILE: + ret=feof(file->handle.file); + break; + + case CFTYPE_CURL: + if((file->buffer_pos == 0) && (!file->still_running)) + ret = 1; + break; + + default: /* unknown or supported type - oh dear */ + ret=-1; + errno=EBADF; + break; + } + return ret; +} + +size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file) +{ + size_t want; + + switch(file->type) { + case CFTYPE_FILE: + want=fread(ptr,size,nmemb,file->handle.file); + break; + + case CFTYPE_CURL: + want = nmemb * size; + + fill_buffer(file,want); + + /* check if theres data in the buffer - if not fill_buffer() + * either errored or EOF */ + if(!file->buffer_pos) + return 0; + + /* ensure only available data is considered */ + if(file->buffer_pos < want) + want = file->buffer_pos; + + /* xfer data to caller */ + memcpy(ptr, file->buffer, want); + + use_buffer(file,want); + + want = want / size; /* number of items */ + break; + + default: /* unknown or supported type - oh dear */ + want=0; + errno=EBADF; + break; + + } + return want; +} + +char *url_fgets(char *ptr, size_t size, URL_FILE *file) +{ + size_t want = size - 1;/* always need to leave room for zero termination */ + size_t loop; + + switch(file->type) { + case CFTYPE_FILE: + ptr = fgets(ptr,size,file->handle.file); + break; + + case CFTYPE_CURL: + fill_buffer(file,want); + + /* check if theres data in the buffer - if not fill either errored or + * EOF */ + if(!file->buffer_pos) + return NULL; + + /* ensure only available data is considered */ + if(file->buffer_pos < want) + want = file->buffer_pos; + + /*buffer contains data */ + /* look for newline or eof */ + for(loop=0;loop < want;loop++) { + if(file->buffer[loop] == '\n') { + want=loop+1;/* include newline */ + break; + } + } + + /* xfer data to caller */ + memcpy(ptr, file->buffer, want); + ptr[want]=0;/* allways null terminate */ + + use_buffer(file,want); + + break; + + default: /* unknown or supported type - oh dear */ + ptr=NULL; + errno=EBADF; + break; + } + + return ptr;/*success */ +} + +void url_rewind(URL_FILE *file) +{ + switch(file->type) { + case CFTYPE_FILE: + rewind(file->handle.file); /* passthrough */ + break; + + case CFTYPE_CURL: + /* halt transaction */ + curl_multi_remove_handle(multi_handle, file->handle.curl); + + /* restart */ + curl_multi_add_handle(multi_handle, file->handle.curl); + + /* ditch buffer - write will recreate - resets stream pos*/ + if(file->buffer) + free(file->buffer); + + file->buffer=NULL; + file->buffer_pos=0; + file->buffer_len=0; + + break; + + default: /* unknown or supported type - oh dear */ + break; + } +} diff --git a/src/gen_list.c b/src/gen_list.c new file mode 100644 index 0000000..8164936 --- /dev/null +++ b/src/gen_list.c @@ -0,0 +1,1261 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2006,2009-2012,2015,2016 Rami Lehti,Pablo Virolainen, + * Mike Markley, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "report.h" +#include "list.h" +#include "gen_list.h" +#include "seltree.h" +#include "db.h" +#include "db_config.h" +#include "commandconf.h" +#include "report.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +#define CLOCK_SKEW 5 + +#ifdef WITH_MHASH +#include +#endif +#include "md.h" +#include "do_md.h" + +void hsymlnk(db_line* line); +void fs2db_line(struct AIDE_STAT_TYPE* fs,db_line* line); +void calc_md(struct AIDE_STAT_TYPE* old_fs,db_line* line); +void no_hash(db_line* line); + +static DB_ATTR_TYPE get_special_report_group(char* group) { + DB_ATTR_TYPE attr = get_groupval(group); + return attr==DB_ATTR_UNDEF?0:attr; +} + +static int bytecmp(byte *b1, byte *b2, size_t len) { + return strncmp((char *)b1, (char *)b2, len); +} + +static int has_str_changed(char* old,char* new) { + return (((old!=NULL && new!=NULL) && + strcmp(old,new)!=0 ) || + ((old!=NULL && new==NULL) || + (old==NULL && new!=NULL))); +} + +static int has_md_changed(byte* old,byte* new,int len) { + error(255,"Debug, has_md_changed %p %p\n",old,new); + return (((old!=NULL && new!=NULL) && + (bytecmp(old,new,len)!=0)) || + ((old!=NULL && new==NULL) || + (old==NULL && new!=NULL))); +} + +#ifdef WITH_ACL +#ifdef WITH_SUN_ACL +static int compare_single_acl(aclent_t* a1,aclent_t* a2) { + if (a1->a_type!=a2->a_type || + a1->a_id!=a2->a_id || + a1->a_perm!=a2->a_perm) { + return RETFAIL; + } + return RETOK; +} +#endif +static int has_acl_changed(acl_type* old, acl_type* new) { +#ifdef WITH_SUN_ACL + int i; +#endif + if (old==NULL && new==NULL) { + return RETOK; + } + if (old==NULL || new==NULL) { + return RETFAIL; + } +#ifdef WITH_POSIX_ACL + if ((!old->acl_a != !new->acl_a) + || (!old->acl_d != !new->acl_d) + || (old->acl_a && strcmp(old->acl_a, new->acl_a)) + || (old->acl_d && strcmp(old->acl_d, new->acl_d))){ + return RETFAIL; + } +#endif +#ifdef WITH_SUN_ACL + if (old->entries!=new->entries) { + return RETFAIL; + } + /* Sort em up. */ + aclsort(old->entries,0,old->acl); + aclsort(new->entries,0,new->acl); + for(i=0;ientries;i++){ + if (compare_single_acl(old->acl+i,new->acl+i)==RETFAIL) { + return RETFAIL; + } + } +#endif + return RETOK; +} +#endif + +#ifdef WITH_XATTR +static int cmp_xattr_node(const void *c1, const void *c2) +{ + const xattr_node *x1 = c1; + const xattr_node *x2 = c2; + + return (strcmp(x1->key, x2->key)); +} +static int have_xattrs_changed(xattrs_type* x1,xattrs_type* x2) { + size_t num = 0; + + if (x1 && (x1->num == 0)) x1 = NULL; + if (x2 && (x2->num == 0)) x2 = NULL; + + if (x1==NULL && x2==NULL) { + return RETOK; + } + if (x1==NULL || x2==NULL) { + return RETFAIL; + } + + if (x1->num != x2->num) { + return RETFAIL; + } + + qsort(x1->ents, x1->num, sizeof(xattr_node), cmp_xattr_node); + qsort(x2->ents, x2->num, sizeof(xattr_node), cmp_xattr_node); + + while (num++ < x1->num) { + const char *x1key = NULL; + const byte *x1val = NULL; + size_t x1vsz = 0; + const char *x2key = NULL; + const byte *x2val = NULL; + size_t x2vsz = 0; + + x1key = x1->ents[num - 1].key; + x1val = x1->ents[num - 1].val; + x1vsz = x1->ents[num - 1].vsz; + + x2key = x2->ents[num - 1].key; + x2val = x2->ents[num - 1].val; + x2vsz = x2->ents[num - 1].vsz; + + if (strcmp(x1key, x2key) || + x1vsz != x2vsz || + memcmp(x1val, x2val, x1vsz)) + return RETFAIL; + } + + return RETOK; +} +#endif + +#ifdef WITH_E2FSATTRS +static int has_e2fsattrs_changed(unsigned long old, unsigned long new) { + return (~(conf->report_ignore_e2fsattrs)&(old^new)); +} +#endif + +/* + * Returns the changed attributes for two database lines. + * + * Attributes are only compared if they exist in both database lines. +*/ +static DB_ATTR_TYPE get_changed_attributes(db_line* l1,db_line* l2) { + +#define easy_compare(a,b) \ + if((a&l1->attr && (a&l2->attr)) && l1->b!=l2->b){\ + ret|=a;\ + } + +#define easy_md_compare(a,b,c) \ + if((a&l1->attr && (a&l2->attr)) && has_md_changed(l1->b,l2->b, c)){ \ + ret|=a; \ + } + +#define easy_function_compare(a,b,c) \ + if((a&l1->attr && (a&l2->attr)) && c(l1->b,l2->b)){ \ + ret|=a; \ + } + + DB_ATTR_TYPE ret=0; + + if ((DB_FTYPE&l1->attr && DB_FTYPE&l2->attr) && (l1->perm&S_IFMT)!=(l2->perm&S_IFMT)) { ret|=DB_FTYPE; } + easy_function_compare(DB_LINKNAME,linkname,has_str_changed); + if ((DB_SIZEG&l1->attr && DB_SIZEG&l2->attr) && l1->size>l2->size){ ret|=DB_SIZEG; } + easy_compare(DB_SIZE,size); + easy_compare(DB_BCOUNT,bcount); + easy_compare(DB_PERM,perm); + easy_compare(DB_UID,uid); + easy_compare(DB_GID,gid); + easy_compare(DB_ATIME,atime); + easy_compare(DB_MTIME,mtime); + easy_compare(DB_CTIME,ctime); + easy_compare(DB_INODE,inode); + easy_compare(DB_LNKCOUNT,nlink); + + easy_md_compare(DB_MD5,md5,HASH_MD5_LEN); + easy_md_compare(DB_SHA1,sha1,HASH_SHA1_LEN); + easy_md_compare(DB_RMD160,rmd160,HASH_RMD160_LEN); + easy_md_compare(DB_TIGER,tiger,HASH_TIGER_LEN); + easy_md_compare(DB_SHA256,sha256,HASH_SHA256_LEN); + easy_md_compare(DB_SHA512,sha512,HASH_SHA512_LEN); + +#ifdef WITH_MHASH + easy_md_compare(DB_CRC32,crc32,HASH_CRC32_LEN); + easy_md_compare(DB_HAVAL,haval,HASH_HAVAL256_LEN); + easy_md_compare(DB_GOST,gost,HASH_GOST_LEN); + easy_md_compare(DB_CRC32B,crc32b,HASH_CRC32B_LEN); + easy_md_compare(DB_WHIRLPOOL,whirlpool,HASH_WHIRLPOOL_LEN); +#endif + +#ifdef WITH_ACL + easy_function_compare(DB_ACL,acl,has_acl_changed); +#endif +#ifdef WITH_XATTR + easy_function_compare(DB_XATTRS,xattrs,have_xattrs_changed); +#endif +#ifdef WITH_SELINUX + easy_function_compare(DB_SELINUX,cntx,has_str_changed); +#endif +#ifdef WITH_E2FSATTRS + easy_function_compare(DB_E2FSATTRS,e2fsattrs,has_e2fsattrs_changed); +#endif + error(255,"Debug, changed attributes for entry %s [%llx %llx]: %llx\n", l1->filename,l1->attr,l2->attr,ret); + return ret; +} + +int compare_node_by_path(const void *n1, const void *n2) +{ + const seltree *x1 = n1; + const seltree *x2 = n2; + return strcmp(x1->path, x2->path); +} + +char* strrxtok(char* rx) +{ + char*p=NULL; + char*t=NULL; + size_t i=0; + + /* The following code assumes that the first character is a slash */ + size_t lastslash=1; + + p=strdup(rx); + p[0]='/'; + + for(i=1;iparent) + depth++; + + return depth; +} + +/* This function returns a node with the same inode value as the 'file' */ +/* The only place it is used is in add_file_to_tree() function */ +static seltree* get_seltree_inode(seltree* tree, db_line* file, int db) +{ + seltree* node=NULL; + list* r=NULL; + char* tmp=NULL; + + if(tree==NULL){ + return NULL; + } + + /* found the match */ + if((db == DB_NEW && + tree->new_data != NULL && + file->inode == tree->new_data->inode) || + (db == DB_OLD && + tree->old_data != NULL && + file->inode == tree->old_data->inode)) { + return tree; + } + + /* tmp is the directory of the file->filename */ + tmp=strgetndirname(file->filename,treedepth(tree)+1); + for(r=tree->childs;r;r=r->next){ + /* We are interested only in files with the same regexp specification */ + if(strlen(tmp) == strlen(file->filename) || + strncmp(((seltree*)r->data)->path,tmp,strlen(tmp)+1)==0){ + node=get_seltree_inode((seltree*)r->data,file,db); + if(node!=NULL){ + break; + } + } + } + free(tmp); + return node; +} + +seltree* get_seltree_node(seltree* tree,char* path) +{ + seltree* node=NULL; + list* r=NULL; + char* tmp=NULL; + + if(tree==NULL){ + return NULL; + } + + if(strncmp(path,tree->path,strlen(path)+1)==0){ + return tree; + } + else{ + tmp=strgetndirname(path,treedepth(tree)+1); + for(r=tree->childs;r;r=r->next){ + if(strncmp(((seltree*)r->data)->path,tmp,strlen(tmp)+1)==0){ + node=get_seltree_node((seltree*)r->data,path); + if(node!=NULL){ + /* Don't leak memory */ + free(tmp); + return node; + } + } + } + free(tmp); + } + return NULL; +} + +void copy_rule_ref(seltree* node, rx_rule* r) +{ + if( r!=NULL ){ + node->conf_lineno = r->conf_lineno; + node->rx=strdup(r->rx); + } else { + node->conf_lineno = -1; + node->rx=NULL; + } +} + +seltree* new_seltree_node( + seltree* tree, + char*path, + int isrx, + rx_rule* r) +{ + seltree* node=NULL; + seltree* parent=NULL; + char* tmprxtok = NULL; + + node=(seltree*)malloc(sizeof(seltree)); + node->childs=NULL; + node->path=strdup(path); + node->sel_rx_lst=NULL; + node->neg_rx_lst=NULL; + node->equ_rx_lst=NULL; + node->checked=0; + node->attr=0; + node->new_data=NULL; + node->old_data=NULL; + + copy_rule_ref(node,r); + + if(tree!=NULL){ + tmprxtok = strrxtok(path); + if(isrx){ + parent=get_seltree_node(tree,tmprxtok); + }else { + char* dirn=strlastslash(path); + parent=get_seltree_node(tree,dirn); + free(dirn); + } + if(parent==NULL){ + if(isrx){ + parent=new_seltree_node(tree,tmprxtok,isrx,r); + }else { + char* dirn=strlastslash(path); + parent=new_seltree_node(tree,dirn,isrx,r); + free(dirn); + } + } + free(tmprxtok); + parent->childs=list_sorted_insert(parent->childs,(void*)node, compare_node_by_path); + node->parent=parent; + }else { + node->parent=NULL; + } + return node; +} + +void gen_seltree(list* rxlist,seltree* tree,char type) +{ + pcre* rxtmp = NULL; + const char* pcre_error; + int pcre_erroffset; + + seltree* curnode = NULL; + list* r = NULL; + char* rxtok = NULL; + rx_rule* rxc = NULL; + + for(r=rxlist;r;r=r->next){ + rx_rule* curr_rule = (rx_rule*)r->data; + + + rxtok=strrxtok(curr_rule->rx); + curnode=get_seltree_node(tree,rxtok); + + if(curnode==NULL){ + curnode=new_seltree_node(tree,rxtok,1,curr_rule); + } + + error(240,"Handling %s with %c \"%s\" with node \"%s\"\n",rxtok,type,curr_rule->rx,curnode->path); + + if((rxtmp=pcre_compile(curr_rule->rx, PCRE_ANCHORED, &pcre_error, &pcre_erroffset, NULL)) == NULL) { + error(0,_("Error in regexp '%s' at %i: %s\n"),curr_rule->rx, pcre_erroffset, pcre_error); + }else{ + /* replace regexp text with regexp compiled */ + rxc=(rx_rule*)malloc(sizeof(rx_rule)); + /* and copy the rest */ + rxc->rx=curr_rule->rx; + rxc->crx=rxtmp; + rxc->attr=curr_rule->attr; + rxc->conf_lineno=curr_rule->conf_lineno; + rxc->restriction=curr_rule->restriction; + + switch (type){ + case 's':{ + curnode->sel_rx_lst=list_append(curnode->sel_rx_lst,(void*)rxc); + break; + } + case 'n':{ + curnode->neg_rx_lst=list_append(curnode->neg_rx_lst,(void*)rxc); + break; + } + case 'e':{ + curnode->equ_rx_lst=list_append(curnode->equ_rx_lst,(void*)rxc); + break; + } + } + } + /* Data should not be free'ed because it's in rxc struct + * and freeing is done if error occour. + */ + free(rxtok); + } +} + +static RESTRICTION_TYPE get_file_type(mode_t mode) { + switch (mode & S_IFMT) { + case S_IFREG: return RESTRICTION_FT_REG; + case S_IFDIR: return RESTRICTION_FT_DIR; +#ifdef S_IFIFO + case S_IFIFO: return RESTRICTION_FT_FIFO; +#endif + case S_IFLNK: return RESTRICTION_FT_LNK; + case S_IFBLK: return RESTRICTION_FT_BLK; + case S_IFCHR: return RESTRICTION_FT_CHR; +#ifdef S_IFSOCK + case S_IFSOCK: return RESTRICTION_FT_SOCK; +#endif +#ifdef S_IFDOOR + case S_IFDOOR: return RESTRICTION_FT_DOOR; +#endif +#ifdef S_IFDOOR + case S_IFPORT: return RESTRICTION_FT_PORT; +#endif + default: return RESTRICTION_NULL; + } +} + +static int check_list_for_match(list* rxrlist,char* text,DB_ATTR_TYPE* attr, RESTRICTION_TYPE file_type) +{ + list* r=NULL; + int retval=1; + int pcre_retval; + pcre_extra *pcre_extra = NULL; + for(r=rxrlist;r;r=r->next){ + pcre_retval=pcre_exec((pcre*)((rx_rule*)r->data)->crx, pcre_extra, text, strlen(text), 0, PCRE_PARTIAL_SOFT, NULL, 0); + if (pcre_retval >= 0) { + error(231,"\"%s\" matches (pcre_exec return value: %i) rule from line #%ld: %s\n",text, pcre_retval, ((rx_rule*)r->data)->conf_lineno,((rx_rule*)r->data)->rx); + if (!((rx_rule*)r->data)->restriction || file_type&((rx_rule*)r->data)->restriction) { + *attr=((rx_rule*)r->data)->attr; + error(231,"\"%s\" matches restriction (%u) for rule from line #%ld: %s\n",text, ((rx_rule*)r->data)->restriction, ((rx_rule*)r->data)->conf_lineno,((rx_rule*)r->data)->rx); + return 0; + } else { + error(232,"\"%s\" doesn't match restriction (%u) for rule from line #%ld: %s\n",text, ((rx_rule*)r->data)->restriction, ((rx_rule*)r->data)->conf_lineno,((rx_rule*)r->data)->rx); + retval=-1; + } + } else if (pcre_retval == PCRE_ERROR_PARTIAL) { + error(232,"\"%s\" PARTIAL matches (pcre_exec return value: %i) rule from line #%ld: %s\n",text, pcre_retval, ((rx_rule*)r->data)->conf_lineno,((rx_rule*)r->data)->rx); + retval=-1; + } else { + error(232,"\"%s\" doesn't match (pcre_exec return value: %i) rule from line #%ld: %s\n",text, pcre_retval,((rx_rule*)r->data)->conf_lineno,((rx_rule*)r->data)->rx); + } + } + return retval; +} + +/* + * Function check_node_for_match() + * calls itself recursively to go to the top and then back down. + * uses check_list_for_match() + * returns: + * 0, if a negative rule was matched + * 1, if a selective rule was matched + * 2, if a equals rule was matched + * retval if no rule was matched. + * retval&3 if no rule was matched and first in the recursion + * to keep state revat is orred with: + * 4, matched deeper on equ rule + * 8, matched deeper on sel rule + *16, this is a recursed call + */ + +static int check_node_for_match(seltree*node,char*text, mode_t perm, int retval,DB_ATTR_TYPE* attr) +{ + int top=0; + RESTRICTION_TYPE file_type; + + if(node==NULL){ + return retval; + } + + file_type = get_file_type(perm); + + /* if this call is not recursive we check the equals list and we set top * + * and retval so we know following calls are recursive */ + if(!(retval&16)){ + top=1; + retval|=16; + + switch (check_list_for_match(node->equ_rx_lst, text, attr, file_type)) { + case 0: { + error(220, "check_node_for_match: equal match for '%s'\n", text); + retval|=2|4; + break; + } + case -1: { + if(S_ISDIR(perm) && get_seltree_node(node,text)==NULL) { + error(220, "check_node_for_match: creating new seltree node for '%s'\n", text); + new_seltree_node(node,text,0,NULL); + } + break; + } + } + } + /* We'll use retval to pass information on whether to recurse + * the dir or not */ + + + /* If 4 and 8 are not set, we will check for matches */ + if(!(retval&(4|8))){ + switch (check_list_for_match(node->sel_rx_lst, text, attr, file_type)) { + case 0: { + error(220, "check_node_for_match: selective match for '%s'\n", text); + retval|=1|8; + break; + } + case -1: { + if(S_ISDIR(perm) && get_seltree_node(node,text)==NULL) { + error(220, "check_node_for_match: creating new seltree node for '%s'\n", text); + new_seltree_node(node,text,0,NULL); + } + break; + } + } + } + + /* Now let's check the ancestors */ + retval=check_node_for_match(node->parent,text, perm, retval,attr); + + + /* Negative regexps are the strongest so they are checked last */ + /* If this file is to be added */ + if(retval){ + if(!check_list_for_match(node->neg_rx_lst, text, attr, file_type)){ + error(220, "check_node_for_match: negative match for '%s'\n", text); + retval=0; + } + } + /* Now we discard the info whether a match was made or not * + * and just return 0,1 or 2 */ + if(top){ + retval&=3; + } + return retval; +} + +void print_tree(seltree* tree) { + + list* r; + rx_rule* rxc; + error(220,"tree: \"%s\"\n",tree->path); + + for(r=tree->sel_rx_lst;r!=NULL;r=r->next) { + rxc=r->data; + error(220,"%li\t%s\n",rxc->conf_lineno,rxc->rx); + } + for(r=tree->equ_rx_lst;r!=NULL;r=r->next) { + rxc=r->data; + error(220,"%li=\t%s\n",rxc->conf_lineno,rxc->rx); + } + + for(r=tree->neg_rx_lst;r!=NULL;r=r->next) { + rxc=r->data; + error(220,"%li!\t%s\n",rxc->conf_lineno,rxc->rx); + } + + for(r=tree->childs;r!=NULL;r=r->next) { + print_tree(r->data); + } +} + +seltree* gen_tree(list* prxlist,list* nrxlist,list* erxlist) +{ + seltree* tree=NULL; + + tree=new_seltree_node(NULL,"/",0,NULL); + + gen_seltree(prxlist,tree,'s'); + gen_seltree(nrxlist,tree,'n'); + gen_seltree(erxlist,tree,'e'); + + print_tree(tree); + + return tree; +} + +/* + * strip_dbline() + * strips given dbline + */ +void strip_dbline(db_line* line) +{ +#define checked_free(x) do { free(x); x=NULL; } while (0) + + DB_ATTR_TYPE attr = line->attr; + + /* filename is always needed, hence it is never stripped */ + if(!(attr&DB_LINKNAME)){ + checked_free(line->linkname); + } + /* permissions are always needed for file type detection, hence they are + * never stripped */ + if(!(attr&DB_UID)){ + line->uid=0; + } + if(!(attr&DB_GID)){ + line->gid=0; + } + if(!(attr&DB_ATIME)){ + line->atime=0; + } + if(!(attr&DB_CTIME)){ + line->ctime=0; + } + if(!(attr&DB_MTIME)){ + line->mtime=0; + } + /* inode is always needed for ignoring changed filename, hence it is + * never stripped */ + if(!(attr&DB_LNKCOUNT)){ + line->nlink=0; + } + if(!(attr&DB_SIZE)&&!(attr&DB_SIZEG)){ + line->size=0; + } + if(!(attr&DB_BCOUNT)){ + line->bcount=0; + } + + if(!(attr&DB_MD5)){ + checked_free(line->md5); + } + if(!(attr&DB_SHA1)){ + checked_free(line->sha1); + } + if(!(attr&DB_RMD160)){ + checked_free(line->rmd160); + } + if(!(attr&DB_TIGER)){ + checked_free(line->tiger); + } + if(!(attr&DB_HAVAL)){ + checked_free(line->haval); + } + if(!(attr&DB_CRC32)){ + checked_free(line->crc32); + } +#ifdef WITH_MHASH + if(!(attr&DB_CRC32B)){ + checked_free(line->crc32b); + } + if(!(attr&DB_GOST)){ + checked_free(line->gost); + } + if(!(attr&DB_WHIRLPOOL)){ + checked_free(line->whirlpool); + } +#endif + if(!(attr&DB_SHA256)){ + checked_free(line->sha256); + } + if(!(attr&DB_SHA512)){ + checked_free(line->sha512); + } +#ifdef WITH_ACL + if(!(attr&DB_ACL)){ + if (line->acl) + { + free(line->acl->acl_a); + free(line->acl->acl_d); + } + checked_free(line->acl); + } +#endif +#ifdef WITH_XATTR + if(!(attr&DB_XATTRS)){ + if (line->xattrs) + free(line->xattrs->ents); + checked_free(line->xattrs); + } +#endif +#ifdef WITH_SELINUX + if(!(attr&DB_SELINUX)){ + checked_free(line->cntx); + } +#endif + /* e2fsattrs is stripped within e2fsattrs2line in do_md */ +} + +/* + * add_file_to_tree + * db = which db this file belongs to + * attr attributes to add + */ +static void add_file_to_tree(seltree* tree,db_line* file,int db, + DB_ATTR_TYPE attr) +{ + seltree* node=NULL; + DB_ATTR_TYPE localignorelist=0; + DB_ATTR_TYPE ignored_added_attrs, ignored_removed_attrs, ignored_changed_attrs; + + node=get_seltree_node(tree,file->filename); + + if(!node){ + node=new_seltree_node(tree,file->filename,0,NULL); + } + + if(file==NULL){ + error(0, "add_file_to_tree was called with NULL db_line\n"); + } + + /* add note to this node which db has modified it */ + node->checked|=db; + + node->attr=attr; + + strip_dbline(file); + + switch (db) { + case DB_OLD: { + node->old_data=file; + break; + } + case DB_NEW: { + node->new_data=file; + break; + } + case DB_OLD|DB_NEW: { + node->new_data=file; + if(conf->action&DO_INIT) { + node->checked|=NODE_FREE; + } else { + free_db_line(node->new_data); + free(node->new_data); + node->new_data=NULL; + } + return; + } + } + /* We have a way to ignore some changes... */ + ignored_added_attrs = get_special_report_group("report_ignore_added_attrs"); + ignored_removed_attrs = get_special_report_group("report_ignore_removed_attrs"); + ignored_changed_attrs = get_special_report_group("report_ignore_changed_attrs"); + + if((node->checked&DB_OLD)&&(node->checked&DB_NEW)){ + if (((node->old_data)->attr&~((node->new_data)->attr)&~(ignored_removed_attrs))|(~((node->old_data)->attr)&(node->new_data)->attr&~(ignored_added_attrs))) { + error(2,"Entry %s in databases has different attributes: %llx %llx\n", + node->old_data->filename,node->old_data->attr,node->new_data->attr); + } + + node->changed_attrs=get_changed_attributes(node->old_data,node->new_data); + /* Free the data if same else leave as is for report_tree */ + if((~(ignored_changed_attrs)&node->changed_attrs)==RETOK){ + /* FIXME this messes up the tree on SunOS. Don't know why. Fix + needed badly otherwise we leak memory like hell. */ + + node->changed_attrs=0; + + free_db_line(node->old_data); + free(node->old_data); + node->old_data=NULL; + + /* Free new data if not needed for write_tree */ + if(conf->action&DO_INIT) { + node->checked|=NODE_FREE; + } else { + free_db_line(node->new_data); + free(node->new_data); + node->new_data=NULL; + } + return; + } + } + + /* Do verification if file was moved only if we are asked for it. + * old and new data are NULL only if file present in both DBs + * and has not been changed. + */ + if( (node->old_data!=NULL || node->new_data!=NULL) && + (file->attr & DB_CHECKINODE)) { + /* Check if file was moved (same inode, different name in the other DB)*/ + db_line *oldData; + db_line *newData; + seltree* moved_node; + + moved_node=get_seltree_inode(tree,file,db==DB_OLD?DB_NEW:DB_OLD); + if(!(moved_node == NULL || moved_node == node)) { + /* There's mo match for inode or it matches the node with the same name. + * In first case we don't have a match to compare with. + * In the second - we already compared those files. */ + if(db == DB_NEW) { + newData = node->new_data; + oldData = moved_node->old_data; + } else { + newData = moved_node->new_data; + oldData = node->old_data; + } + + localignorelist=(oldData->attr^newData->attr)&(~(DB_NEWFILE|DB_RMFILE|DB_CHECKINODE)); + + if (localignorelist!=0) { + error(220,"Ignoring moved entry (\"%s\" [%llx] => \"%s\" [%llx]) due to different attributes: %llx\n", + oldData->filename, oldData->attr, newData->filename, newData->attr, localignorelist); + } else { + /* Free the data if same else leave as is for report_tree */ + if ((get_changed_attributes(oldData, newData)&~(ignored_changed_attrs|DB_CTIME)) == RETOK) { + node->checked |= db==DB_NEW ? NODE_MOVED_IN : NODE_MOVED_OUT; + moved_node->checked |= db==DB_NEW ? NODE_MOVED_OUT : NODE_MOVED_IN; + error(220,_("Entry was moved: %s [%llx] => %s [%llx]\n"), + oldData->filename , oldData->attr, newData->filename, newData->attr); + } else { + error(220,"Ignoring moved entry (\"%s\" => \"%s\") because the entries mismatch\n", + oldData->filename, newData->filename); + } + } + } + } + if( (db == DB_NEW) && + (node->new_data!=NULL) && + (file->attr & DB_NEWFILE) ){ + node->checked|=NODE_ALLOW_NEW; + } + if( (db == DB_OLD) && + (node->old_data!=NULL) && + (file->attr & DB_RMFILE) ){ + node->checked|=NODE_ALLOW_RM; + } +} + +int check_rxtree(char* filename,seltree* tree,DB_ATTR_TYPE* attr, mode_t perm) +{ + int retval=0; + char * tmp=NULL; + char * parentname=NULL; + seltree* pnode=NULL; + + parentname=strdup(filename); + tmp=strrchr(parentname,'/'); + if(tmp!=parentname){ + *tmp='\0'; + }else { + + if(parentname[1]!='\0'){ + /* we are in the root dir */ + parentname[1]='\0'; + } + } + + if(conf->limit!=NULL) { + retval=pcre_exec(conf->limit_crx, NULL, filename, strlen(filename), 0, PCRE_PARTIAL_SOFT, NULL, 0); + if (retval >= 0) { + error(220, "check_rxtree: %s does match limit: %s\n", filename, conf->limit); + } else if (retval == PCRE_ERROR_PARTIAL) { + error(220, "check_rxtree: %s does PARTIAL match limit: %s\n", filename, conf->limit); + if(S_ISDIR(perm) && get_seltree_node(tree,filename)==NULL){ + error(220, "check_rxtree: creating new seltree node for '%s'\n", filename); + new_seltree_node(tree,filename,0,NULL); + } + return -1; + } else { + error(220, "check_rxtree: %s does NOT match limit: %s\n", filename, conf->limit); + return -2; + } + } + + pnode=get_seltree_node(tree,parentname); + + *attr=0; + retval=check_node_for_match(pnode,filename, perm, 0,attr); + + free(parentname); + + return retval; +} + +db_line* get_file_attrs(char* filename,DB_ATTR_TYPE attr, struct AIDE_STAT_TYPE *fs) +{ + db_line* line=NULL; + time_t cur_time; + + if(!(attr&DB_RDEV)) + fs->st_rdev=0; + /* + Get current time for future time notification. + */ + cur_time=time(NULL); + + if (cur_time==(time_t)-1) { + char* er=strerror(errno); + if (er==NULL) { + error(0,_("Can not get current time. strerror failed for %i\n"),errno); + } else { + error(0,_("Can not get current time with reason %s\n"),er); + } + } else { + + if(fs->st_atime>cur_time){ + error(CLOCK_SKEW,_("%s atime in future\n"),filename); + } + if(fs->st_mtime>cur_time){ + error(CLOCK_SKEW,_("%s mtime in future\n"),filename); + } + if(fs->st_ctime>cur_time){ + error(CLOCK_SKEW,_("%s ctime in future\n"),filename); + } + } + + /* + Malloc if we have something to store.. + */ + + line=(db_line*)malloc(sizeof(db_line)); + + memset(line,0,sizeof(db_line)); + + /* + We want filename + */ + + line->attr=attr|DB_FILENAME; + + /* + Just copy some needed fields. + */ + + line->fullpath=filename; + line->filename=&filename[conf->root_prefix_length]; + line->perm_o=fs->st_mode; + line->size_o=fs->st_size; + line->linkname=NULL; + + /* + Handle symbolic link + */ + + hsymlnk(line); + + /* + Set normal part + */ + + fs2db_line(fs,line); + + /* + ACL stuff + */ + +#ifdef WITH_ACL + acl2line(line); +#endif + +#ifdef WITH_XATTR + xattrs2line(line); +#endif + +#ifdef WITH_SELINUX + selinux2line(line); +#endif + +#ifdef WITH_E2FSATTRS + e2fsattrs2line(line); +#endif + + if (attr&DB_HASHES && S_ISREG(fs->st_mode)) { + calc_md(fs,line); + } else { + /* + We cannot calculate hash for nonfile. + Mark it to attr. + */ + no_hash(line); + } + + return line; +} + +static void write_tree(seltree* node) { + list* r=NULL; + if (node->checked&DB_NEW) { + db_writeline(node->new_data,conf); + if (node->checked&NODE_FREE) { + free_db_line(node->new_data); + free(node->new_data); + node->new_data=NULL; + } + } + for (r=node->childs;r;r=r->next) { + write_tree((seltree*)r->data); + } +} + +void populate_tree(seltree* tree) +{ + /* FIXME this function could really use threads */ + int add=0; + db_line* old=NULL; + db_line* new=NULL; + int initdbwarningprinted=0; + DB_ATTR_TYPE attr=0; + seltree* node=NULL; + + /* With this we avoid unnecessary checking of removed files. */ + if(conf->action&DO_INIT){ + initdbwarningprinted=1; + } + + if(conf->action&DO_DIFF){ + while((new=db_readline(DB_NEW)) != NULL){ + /* FIXME add support config checking at this stage + config check = add only those files that match config rxs + make this configurable + Only configurability is not implemented. + */ + /* This is needed because check_rxtree assumes there is a parent + for the node for old->filename */ + if((node=get_seltree_node(tree,new->filename))==NULL){ + node=new_seltree_node(tree,new->filename,0,NULL); + } + if((add=check_rxtree(new->filename,tree,&attr, new->perm))>0){ + add_file_to_tree(tree,new,DB_NEW,attr); + } else { + free_db_line(new); + free(new); + new=NULL; + } + } + } + + if((conf->action&DO_INIT)||(conf->action&DO_COMPARE)){ + /* FIXME */ + new=NULL; + while((new=db_readline(DB_DISK)) != NULL) { + add_file_to_tree(tree,new,DB_NEW,attr); + } + } + if((conf->action&DO_COMPARE)||(conf->action&DO_DIFF)){ + while((old=db_readline(DB_OLD)) != NULL) { + /* This is needed because check_rxtree assumes there is a parent + for the node for old->filename */ + if((node=get_seltree_node(tree,old->filename))==NULL){ + node=new_seltree_node(tree,old->filename,0,NULL); + } + add=check_rxtree(old->filename,tree,&attr, old->perm); + if(add > 0) { + add_file_to_tree(tree,old,DB_OLD,attr); + } else if (conf->limit!=NULL && add < 0) { + add_file_to_tree(tree,old,DB_OLD|DB_NEW,attr); + }else{ + free_db_line(old); + free(old); + old=NULL; + if(!initdbwarningprinted){ + error(3,_("WARNING: Old db contains a entry that shouldn\'t be there, run --init or --update\n")); + initdbwarningprinted=1; + } + } + } + } + if(conf->action&DO_INIT) { + write_tree(tree); + } +} + +void hsymlnk(db_line* line) { + + if((S_ISLNK(line->perm_o))){ + int len=0; +#ifdef WITH_ACL + if(conf->no_acl_on_symlinks!=1) { + line->attr&=(~DB_ACL); + } +#endif + + if(conf->warn_dead_symlinks==1) { + struct AIDE_STAT_TYPE fs; + int sres; + sres=AIDE_STAT_FUNC(line->fullpath,&fs); + if (sres!=0 && sres!=EACCES) { + error(4,"Dead symlink detected at %s\n",line->fullpath); + } + if(!(line->attr&DB_RDEV)) + fs.st_rdev=0; + } + /* + Is this valid?? + No, We should do this elsewhere. + */ + line->linkname=(char*)malloc(_POSIX_PATH_MAX+1); + if(line->linkname==NULL){ + error(0,_("malloc failed in hsymlnk()\n")); + abort(); + } + + /* + Remember to nullify the buffer, because man page says + + readlink places the contents of the symbolic link path in + the buffer buf, which has size bufsiz. readlink does not + append a NUL character to buf. It will truncate the con- + tents (to a length of bufsiz characters), in case the + buffer is too small to hold all of the contents. + + */ + memset(line->linkname,0,_POSIX_PATH_MAX+1); + + len=readlink(line->fullpath,line->linkname,_POSIX_PATH_MAX+1); + + /* + * We use realloc :) + */ + line->linkname=realloc(line->linkname,len+1); + } else { + line->attr&=(~DB_LINKNAME); + } + +} +// vi: ts=8 sw=2 diff --git a/src/getopt.c b/src/getopt.c new file mode 100644 index 0000000..6789fcd --- /dev/null +++ b/src/getopt.c @@ -0,0 +1,1049 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 + Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#include "aide.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +# ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = NULL; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +# if HAVE_STRING_H +# include +# else +# include +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +extern char *getenv (); +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; + +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +# ifdef text_set_element +text_set_element (__libc_subinit, store_args_and_env); +# endif /* text_set_element */ + +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#ifdef _LIBC + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/src/getopt1.c b/src/getopt1.c new file mode 100644 index 0000000..21d7f69 --- /dev/null +++ b/src/getopt1.c @@ -0,0 +1,186 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + This file was part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "aide.h" + +#include "getopt.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/src/list.c b/src/list.c new file mode 100644 index 0000000..c1b2464 --- /dev/null +++ b/src/list.c @@ -0,0 +1,230 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2005,2006,2010 Rami Lehti,Pablo Virolainen, + * Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include "list.h" +#include "report.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +/* list + * limitations: + * Only the head knows where the tail is + * Every item knows where the head is + + * And that is not true anymore. + * Now list has header which knows head and tail. + * Every item knows header. + + */ + + +/* list_sorted_insert() + * Adds an item in a sorted list: + * - The first argument is the head of the list + * - The second argument is the data to be added + * - The third argument is the function pointer to the compare function to use + * - Returns the head of the list + */ +list* list_sorted_insert(list* listp, void* data, int (*compare) (const void*, const void*)) { + list* newitem=NULL; + list* curitem=NULL; + newitem=(list*)malloc(sizeof(list)); + if (newitem==NULL) { + error(0,"Not enough memory to add a new item to list.\n"); + exit(EXIT_FAILURE); + } + if (listp==NULL){ + list_header* header=(list_header*)malloc(sizeof(list_header)); + if (header==NULL){ + error(0,"Not enough memory for list header allocation\n"); + exit(EXIT_FAILURE); + } + newitem->data=data; + newitem->header=header; + newitem->next=NULL; + newitem->prev=NULL; + header->head=newitem; + header->tail=newitem; + return newitem; + } else { + /* add element in sorted, non-empty list (use insertion sort) */ + curitem = listp->header->head; + newitem->header=listp->header; + newitem->data=data; + if (compare(newitem->data,curitem->data) <= 0) { + /* new element is the new head */ + listp->header->head=newitem; + curitem->prev=newitem; + newitem->next=curitem; + newitem->prev=NULL; + return newitem; + } else { + /* find position for new element */ + while(compare(newitem->data, curitem->data) > 0 && curitem->next != NULL) { + curitem=curitem->next; + } + if (curitem->next == NULL && compare(newitem->data, curitem->data) > 0) { + /* new element is the new tail */ + listp->header->tail=newitem; + curitem->next=newitem; + newitem->prev=curitem; + newitem->next=NULL; + } else { + /* new element is an inner element */ + curitem->prev->next=newitem; + newitem->prev=curitem->prev; + curitem->prev=newitem; + newitem->next=curitem; + } + } + return listp; + } +} + +/* list_append() + * append an item to list + * returns the head + * The first argument is the head of the list + * The second argument is the data to be added + * Returns list head + */ + + +/* + * Some way to handle mallocs failure would be nice. + */ + +list* list_append(list* listp,void*data) +{ + list* newitem=NULL; + newitem=(list*)malloc(sizeof(list)); + + if (newitem==NULL) { + error(0,"Not enough memory to add a new item to list.\n"); + exit(EXIT_FAILURE); + } + + if(listp==NULL){ + list_header* header=(list_header*)malloc(sizeof(list_header)); + + if (header==NULL){ + error(0,"Not enough memory for list header allocation\n"); + exit(EXIT_FAILURE); + } + + newitem->data=data; + newitem->header=header; + newitem->next=NULL; + newitem->prev=NULL; + + header->head=newitem; + header->tail=newitem; + + return newitem; + }else { + + /* We have nonempthy list. + * add to last + */ + + newitem->prev=listp->header->tail; + newitem->next=NULL; + newitem->data=data; + newitem->header=listp->header; + + listp->header->tail->next=newitem; + listp->header->tail=newitem; + return listp; + } + /* Not reached */ + return NULL; +} + +/* + * delete_list_item() + * delete a item from list + * returns head of a list. + */ + +list* list_delete_item(list* item){ + list* r; + + + if (item==NULL) { + error(200,"Tried to remove from empthy list\n"); + return item; + } + + if (item->header->head==item->header->tail) { + /* + * Ollaan poistamassa listan ainoaa alkiota. + * T�ll�in palautetaan NULL + */ + free(item->header); + free(item); + return NULL; + } + + /* + * Nyt meill� on listassa ainakin kaksi alkiota + * + */ + + /* poistetaan listan viimeist� alkiota */ + + if (item==item->header->tail){ + + r=item->prev; + item->header->tail=r; + r->next=NULL; + r=r->header->head; + free(item); + return r; + } + + /* + * Poistetaan listan ensimm�inen alkio. + */ + if (item==item->header->head) { + + r=item->next; + item->header->head=r; + r->prev=NULL; + r=r->header->head; + + free(item); + return r; + } + + r=item->prev; + + item->prev->next=item->next; + item->next->prev=item->prev; + + free(item); + r=r->header->head; + + return r; + +} diff --git a/src/md.c b/src/md.c new file mode 100644 index 0000000..98e7816 --- /dev/null +++ b/src/md.c @@ -0,0 +1,373 @@ +/* Aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2005,2006,2010 Rami Lehti, Pablo Virolainen, + * Richard van den Berg + * $Header$ + * + * 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 "aide.h" +#include +#include "md.h" +#include "report.h" +#include +#ifdef WITH_MHASH +#include +#endif +#define HASH_HAVAL_LEN HASH_HAVAL256_LEN + + +/* + It might be a good idea to construct a table, where these values are + stored. Only a speed issue. +*/ + +DB_ATTR_TYPE hash_gcrypt2attr(int i) { + DB_ATTR_TYPE r=0; +#ifdef WITH_GCRYPT + switch (i) { + case GCRY_MD_MD5: { + r=DB_MD5; + break; + } + case GCRY_MD_SHA1: { + r=DB_SHA1; + break; + } + case GCRY_MD_RMD160: { + r=DB_RMD160; + break; + } + case GCRY_MD_TIGER: { + r=DB_TIGER; + break; + } + case GCRY_MD_HAVAL: { + r=DB_HAVAL; + break; + } + case GCRY_MD_SHA256: { + r=DB_SHA256; + break; + } + case GCRY_MD_SHA512: { + r=DB_SHA512; + break; + } + case GCRY_MD_CRC32: { + r=DB_CRC32; + break; + } + default: + break; + } +#endif + return r; +} + +DB_ATTR_TYPE hash_mhash2attr(int i) { + DB_ATTR_TYPE r=0; +#ifdef WITH_MHASH + switch (i) { + case MHASH_CRC32: { + r=DB_CRC32; + break; + } + case MHASH_MD5: { + r=DB_MD5; + break; + } + case MHASH_SHA1: { + r=DB_SHA1; + break; + } + case MHASH_HAVAL: { + r=DB_HAVAL; + break; + } + case MHASH_RMD160: { + r=DB_RMD160; + break; + } + case MHASH_TIGER: { + r=DB_TIGER; + break; + } + case MHASH_GOST: { + r=DB_GOST; + break; + } + case MHASH_CRC32B: { + r=DB_CRC32B; + break; + } + case MHASH_HAVAL224: { + break; + } + case MHASH_HAVAL192: { + break; + } + case MHASH_HAVAL160: { + break; + } + case MHASH_HAVAL128: { + break; + } + case MHASH_TIGER128: { + break; + } + case MHASH_TIGER160: { + break; + } + case MHASH_MD4: { + break; + } + case MHASH_SHA256: { + r=DB_SHA256; + break; + } + case MHASH_SHA512: { + r=DB_SHA512; + break; + } +#ifdef HAVE_MHASH_WHIRLPOOL + case MHASH_WHIRLPOOL: { + r=DB_WHIRLPOOL; + break; + } +#endif + case MHASH_ADLER32: { + break; + } + default: + break; + } +#endif + return r; +} + +/* + Initialise md_container according it's todo_attr field + */ + +int init_md(struct md_container* md) { + + int i; + /* First we check the parameter.. */ +#ifdef _PARAMETER_CHECK_ + if (md==NULL) { + return RETFAIL; + } +#endif + error(255,"init_md called\n"); + /* + We don't have calculator for this yet :) + */ + md->calc_attr=0; +#ifdef WITH_MHASH + error(255,"Mhash library initialization\n"); + for(i=0;i<=HASH_MHASH_COUNT;i++) { + if (((hash_mhash2attr(i)&HASH_USE_MHASH)&md->todo_attr)!=0) { + DB_ATTR_TYPE h=hash_mhash2attr(i); + error(255,"inserting %llu\n",h); + md->mhash_mdh[i]=mhash_init(i); + if (md->mhash_mdh[i]!=MHASH_FAILED) { + md->calc_attr|=h; + } else { + /* + Oops.. + We just don't calculate this. + */ + + md->todo_attr&=~h; + } + + } else { + md->mhash_mdh[i]=MHASH_FAILED; + } + } +#endif +#ifdef WITH_GCRYPT + error(255,"Gcrypt library initialization\n"); + if(!gcry_check_version(GCRYPT_VERSION)) { + error(0,"libgcrypt version mismatch\n"); + exit(VERSION_MISMATCH_ERROR); + } + gcry_control(GCRYCTL_DISABLE_SECMEM, 0); + gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); + if(gcry_md_open(&md->mdh,0,0)!=GPG_ERR_NO_ERROR){ + error(0,"gcrypt_md_open failed\n"); + exit(IO_ERROR); + } + for(i=0;i<=HASH_GCRYPT_COUNT;i++) { + if (((hash_gcrypt2attr(i)&HASH_USE_GCRYPT)&md->todo_attr)!=0) { + DB_ATTR_TYPE h=hash_gcrypt2attr(i); + error(255,"inserting %llu\n",h); + if(gcry_md_enable(md->mdh,i)==GPG_ERR_NO_ERROR){ + md->calc_attr|=h; + } else { + error(0,"gcry_md_enable %i failed",i); + md->todo_attr&=~h; + } + } + } +#endif + return RETOK; +} + +/* + update :) + Just call this when you have more data. + */ + +int update_md(struct md_container* md,void* data,ssize_t size) { + int i; + + error(255,"update_md called\n"); + +#ifdef _PARAMETER_CHECK_ + if (md==NULL||data==NULL) { + return RETFAIL; + } +#endif + +#ifdef WITH_MHASH + + for(i=0;i<=HASH_MHASH_COUNT;i++) { + if (md->mhash_mdh[i]!=MHASH_FAILED) { + mhash (md->mhash_mdh[i], data, size); + } + } + +#endif /* WITH_MHASH */ +#ifdef WITH_GCRYPT + gcry_md_write(md->mdh, data, size); +#endif + return RETOK; +} + +/* + close.. Does some magic. + After this calling update_db is not a good idea. +*/ + +int close_md(struct md_container* md) { + int i; +#ifdef _PARAMETER_CHECK_ + if (md==NULL) { + return RETFAIL; + } +#endif + error(255,"close_md called \n"); +#ifdef WITH_MHASH + for(i=0;i<=HASH_MHASH_COUNT;i++) { + if (md->mhash_mdh[i]!=MHASH_FAILED) { + mhash (md->mhash_mdh[i], NULL, 0); + } + } +#endif /* WITH_MHASH */ +#ifdef WITH_GCRYPT + gcry_md_final(md->mdh); + /* Let's flush the buffers */ + +#define get_libgcrypt_hash(a,b,c,d) \ + if(md->calc_attr&a&HASH_USE_GCRYPT){\ + error(255,"Getting hash %i\n",b);\ + memcpy(md->c,gcry_md_read(md->mdh,b),d);\ + } + + get_libgcrypt_hash(DB_MD5,GCRY_MD_MD5,md5,HASH_MD5_LEN); + get_libgcrypt_hash(DB_SHA1,GCRY_MD_SHA1,sha1,HASH_SHA1_LEN); + get_libgcrypt_hash(DB_TIGER,GCRY_MD_TIGER,tiger,HASH_TIGER_LEN); + get_libgcrypt_hash(DB_RMD160,GCRY_MD_RMD160,rmd160,HASH_RMD160_LEN); + get_libgcrypt_hash(DB_SHA256,GCRY_MD_SHA256,sha256,HASH_SHA256_LEN); + get_libgcrypt_hash(DB_SHA512,GCRY_MD_SHA512,sha512,HASH_SHA512_LEN); + get_libgcrypt_hash(DB_CRC32,GCRY_MD_CRC32,crc32,HASH_CRC32_LEN); + + /*. There might be more hashes in the library. Add those here.. */ + + gcry_md_reset(md->mdh); +#endif + +#ifdef WITH_MHASH +#define get_mhash_hash(b,c) \ + if(md->mhash_mdh[b]!=MHASH_FAILED){ \ + mhash_deinit(md->mhash_mdh[b],(void*)md->c); \ + } + + get_mhash_hash(MHASH_MD5,md5); + get_mhash_hash(MHASH_SHA1,sha1); + get_mhash_hash(MHASH_TIGER,tiger); + get_mhash_hash(MHASH_RMD160,rmd160); + get_mhash_hash(MHASH_CRC32,crc32); + get_mhash_hash(MHASH_HAVAL,haval); + get_mhash_hash(MHASH_GOST,gost); + get_mhash_hash(MHASH_CRC32B,crc32b); + get_mhash_hash(MHASH_SHA256,sha256); + get_mhash_hash(MHASH_SHA512,sha512); +#ifdef HAVE_MHASH_WHIRLPOOL + get_mhash_hash(MHASH_WHIRLPOOL,whirlpool); +#endif + + /* + There might be more hashes in the library we want to use. + Add those here.. + */ + +#endif + return RETOK; +} + +/* + Writes md_container to db_line. + */ + +void md2line(struct md_container* md,struct db_line* line) { + + error(255,"md2line \n"); + +#ifdef _PARAMETER_CHECK_ + if (md==NULL||line==NULL) { + return RETFAIL; + } +#endif + +#define copyhash(a,b,c) \ + if (line->attr&a) { \ + error(255,"Line has %llu\n",a); \ + if (md->calc_attr&a) { \ + error(255,"copying %llu\n",a); \ + line->b=(byte*)malloc(c); \ + memcpy(line->b,md->b,c); \ + } else { \ + line->attr&=~a; \ + } \ + } + + + copyhash(DB_MD5,md5,HASH_MD5_LEN); + copyhash(DB_SHA1,sha1,HASH_SHA1_LEN); + copyhash(DB_RMD160,rmd160,HASH_RMD160_LEN); + copyhash(DB_TIGER,tiger,HASH_TIGER_LEN); + copyhash(DB_CRC32,crc32,HASH_CRC32_LEN); + copyhash(DB_HAVAL,haval,HASH_HAVAL_LEN); + copyhash(DB_GOST,gost,HASH_GOST_LEN); + copyhash(DB_CRC32B,crc32b,HASH_CRC32B_LEN); + + copyhash(DB_SHA256,sha256,HASH_SHA256_LEN); + copyhash(DB_SHA512,sha512,HASH_SHA512_LEN); + copyhash(DB_WHIRLPOOL,whirlpool,HASH_WHIRLPOOL_LEN); +} diff --git a/src/snprintf.c b/src/snprintf.c new file mode 100644 index 0000000..d2072fb --- /dev/null +++ b/src/snprintf.c @@ -0,0 +1,1021 @@ +/* + * NOTE: If you change this file, please merge it into rsync, samba, etc. + */ + +/* + * Copyright Patrick Powell 1995 + * This code is based on code written by Patrick Powell (papowell@astart.com) + * It may be used for any purpose as long as this notice remains intact + * on all source code distributions + */ + +/************************************************************** + * Original: + * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 + * A bombproof version of doprnt (dopr) included. + * Sigh. This sort of thing is always nasty do deal with. Note that + * the version here does not include floating point... + * + * snprintf() is used instead of sprintf() as it does limit checks + * for string length. This covers a nasty loophole. + * + * The other functions are there to prevent NULL pointers from + * causing nast effects. + * + * More Recently: + * Brandon Long 9/15/96 for mutt 0.43 + * This was ugly. It is still ugly. I opted out of floating point + * numbers, but the formatter understands just about everything + * from the normal C string format, at least as far as I can tell from + * the Solaris 2.5 printf(3S) man page. + * + * Brandon Long 10/22/97 for mutt 0.87.1 + * Ok, added some minimal floating point support, which means this + * probably requires libm on most operating systems. Don't yet + * support the exponent (e,E) and sigfig (g,G). Also, fmtint() + * was pretty badly broken, it just wasn't being exercised in ways + * which showed it, so that's been fixed. Also, formated the code + * to mutt conventions, and removed dead code left over from the + * original. Also, there is now a builtin-test, just compile with: + * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm + * and run snprintf for results. + * + * Thomas Roessler 01/27/98 for mutt 0.89i + * The PGP code was using unsigned hexadecimal formats. + * Unfortunately, unsigned formats simply didn't work. + * + * Michael Elkins 03/05/98 for mutt 0.90.8 + * The original code assumed that both snprintf() and vsnprintf() were + * missing. Some systems only have snprintf() but not vsnprintf(), so + * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. + * + * Andrew Tridgell (tridge@samba.org) Oct 1998 + * fixed handling of %.0f + * added test for HAVE_LONG_DOUBLE + * + * tridge@samba.org, idra@samba.org, April 2001 + * got rid of fcvt code (twas buggy and made testing harder) + * added C99 semantics + * + * date: 2002/12/19 19:56:31; author: herb; state: Exp; lines: +2 -0 + * actually print args for %g and %e + * + * date: 2002/06/03 13:37:52; author: jmcd; state: Exp; lines: +8 -0 + * Since includes.h isn't included here, VA_COPY has to be defined here. I don't + * see any include file that is guaranteed to be here, so I'm defining it + * locally. Fixes AIX and Solaris builds. + * + * date: 2002/06/03 03:07:24; author: tridge; state: Exp; lines: +5 -13 + * put the ifdef for HAVE_VA_COPY in one place rather than in lots of + * functions + * + * date: 2002/05/17 14:51:22; author: jmcd; state: Exp; lines: +21 -4 + * Fix usage of va_list passed as an arg. Use __va_copy before using it + * when it exists. + * + * date: 2002/04/16 22:38:04; author: idra; state: Exp; lines: +20 -14 + * Fix incorrect zpadlen handling in fmtfp. + * Thanks to Ollie Oldham for spotting it. + * few mods to make it easier to compile the tests. + * addedd the "Ollie" test to the floating point ones. + * + * Martin Pool (mbp@samba.org) April 2003 + * Remove NO_CONFIG_H so that the test case can be built within a source + * tree with less trouble. + * Remove unnecessary SAFE_FREE() definition. + * + * Martin Pool (mbp@samba.org) May 2003 + * Put in a prototype for dummy_snprintf() to quiet compiler warnings. + * + * Move #endif to make sure VA_COPY, LDOUBLE, etc are defined even + * if the C library has some snprintf functions already. + **************************************************************/ + +#ifndef NO_CONFIG_H +#include "config.h" +#else +#define NULL 0 +#endif + +#ifdef TEST_SNPRINTF /* need math library headers for testing */ + +/* In test mode, we pretend that this system doesn't have any snprintf + * functions, regardless of what config.h says. */ +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# undef HAVE_C99_VSNPRINTF +# undef HAVE_ASPRINTF +# undef HAVE_VASPRINTF +# include +#endif /* TEST_SNPRINTF */ + +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_CTYPE_H +#include +#endif +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF) +/* only include stdio.h if we are not re-defining snprintf or vsnprintf */ +#include + /* make the compiler happy with an empty file */ + void dummy_snprintf(void); + void dummy_snprintf(void) {} +#endif /* HAVE_SNPRINTF, etc */ + +#ifdef HAVE_LONG_DOUBLE +#define LDOUBLE long double +#else +#define LDOUBLE double +#endif + +#if SIZEOF_LONG_LONG +#define LLONG long long +#else +#define LLONG long +#endif + +#ifndef VA_COPY +#if defined HAVE_VA_COPY || defined va_copy +#define VA_COPY(dest, src) va_copy(dest, src) +#else +#ifdef HAVE___VA_COPY +#define VA_COPY(dest, src) __va_copy(dest, src) +#else +#define VA_COPY(dest, src) (dest) = (src) +#endif +#endif + +/* + * dopr(): poor man's version of doprintf + */ + +/* format read states */ +#define DP_S_DEFAULT 0 +#define DP_S_FLAGS 1 +#define DP_S_MIN 2 +#define DP_S_DOT 3 +#define DP_S_MAX 4 +#define DP_S_MOD 5 +#define DP_S_CONV 6 +#define DP_S_DONE 7 + +/* format flags - Bits */ +#define DP_F_MINUS (1 << 0) +#define DP_F_PLUS (1 << 1) +#define DP_F_SPACE (1 << 2) +#define DP_F_NUM (1 << 3) +#define DP_F_ZERO (1 << 4) +#define DP_F_UP (1 << 5) +#define DP_F_UNSIGNED (1 << 6) + +/* Conversion Flags */ +#define DP_C_SHORT 1 +#define DP_C_LONG 2 +#define DP_C_LDOUBLE 3 +#define DP_C_LLONG 4 + +#define char_to_int(p) ((p)- '0') +#ifndef MAX +#define MAX(p,q) (((p) >= (q)) ? (p) : (q)) +#endif + +/* yes this really must be a ||. Don't muck with this (tridge) */ +#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF) + +static size_t dopr(char *buffer, size_t maxlen, const char *format, + va_list args_in); +static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max); +static void fmtint(char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags); +static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags); +static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); + +static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) +{ + char ch; + LLONG value; + LDOUBLE fvalue; + char *strvalue; + int min; + int max; + int state; + int flags; + int cflags; + size_t currlen; + va_list args; + + VA_COPY(args, args_in); + + state = DP_S_DEFAULT; + currlen = flags = cflags = min = 0; + max = -1; + ch = *format++; + + while (state != DP_S_DONE) { + if (ch == '\0') + state = DP_S_DONE; + + switch(state) { + case DP_S_DEFAULT: + if (ch == '%') + state = DP_S_FLAGS; + else + dopr_outch (buffer, &currlen, maxlen, ch); + ch = *format++; + break; + case DP_S_FLAGS: + switch (ch) { + case '-': + flags |= DP_F_MINUS; + ch = *format++; + break; + case '+': + flags |= DP_F_PLUS; + ch = *format++; + break; + case ' ': + flags |= DP_F_SPACE; + ch = *format++; + break; + case '#': + flags |= DP_F_NUM; + ch = *format++; + break; + case '0': + flags |= DP_F_ZERO; + ch = *format++; + break; + default: + state = DP_S_MIN; + break; + } + break; + case DP_S_MIN: + if (isdigit((unsigned char)ch)) { + min = 10*min + char_to_int (ch); + ch = *format++; + } else if (ch == '*') { + min = va_arg (args, int); + ch = *format++; + state = DP_S_DOT; + } else { + state = DP_S_DOT; + } + break; + case DP_S_DOT: + if (ch == '.') { + state = DP_S_MAX; + ch = *format++; + } else { + state = DP_S_MOD; + } + break; + case DP_S_MAX: + if (isdigit((unsigned char)ch)) { + if (max < 0) + max = 0; + max = 10*max + char_to_int (ch); + ch = *format++; + } else if (ch == '*') { + max = va_arg (args, int); + ch = *format++; + state = DP_S_MOD; + } else { + state = DP_S_MOD; + } + break; + case DP_S_MOD: + switch (ch) { + case 'h': + cflags = DP_C_SHORT; + ch = *format++; + break; + case 'l': + cflags = DP_C_LONG; + ch = *format++; + if (ch == 'l') { /* It's a long long */ + cflags = DP_C_LLONG; + ch = *format++; + } + break; + case 'L': + cflags = DP_C_LDOUBLE; + ch = *format++; + break; + default: + break; + } + state = DP_S_CONV; + break; + case DP_S_CONV: + switch (ch) { + case 'd': + case 'i': + if (cflags == DP_C_SHORT) + value = va_arg (args, int); + else if (cflags == DP_C_LONG) + value = va_arg (args, long int); + else if (cflags == DP_C_LLONG) + value = va_arg (args, LLONG); + else + value = va_arg (args, int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'o': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (long)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); + break; + case 'u': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (LLONG)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'X': + flags |= DP_F_UP; + case 'x': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (LLONG)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); + break; + case 'f': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + /* um, floating point? */ + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + break; + case 'E': + flags |= DP_F_UP; + case 'e': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + break; + case 'G': + flags |= DP_F_UP; + case 'g': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + break; + case 'c': + dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + break; + case 's': + strvalue = va_arg (args, char *); + if (!strvalue) strvalue = "(NULL)"; + if (max == -1) { + max = strlen(strvalue); + } + if (min > 0 && max >= 0 && min > max) max = min; + fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); + break; + case 'p': + strvalue = va_arg (args, void *); + fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); + break; + case 'n': + if (cflags == DP_C_SHORT) { + short int *num; + num = va_arg (args, short int *); + *num = currlen; + } else if (cflags == DP_C_LONG) { + long int *num; + num = va_arg (args, long int *); + *num = (long int)currlen; + } else if (cflags == DP_C_LLONG) { + LLONG *num; + num = va_arg (args, LLONG *); + *num = (LLONG)currlen; + } else { + int *num; + num = va_arg (args, int *); + *num = currlen; + } + break; + case '%': + dopr_outch (buffer, &currlen, maxlen, ch); + break; + case 'w': + /* not supported yet, treat as next char */ + ch = *format++; + break; + default: + /* Unknown, skip */ + break; + } + ch = *format++; + state = DP_S_DEFAULT; + flags = cflags = min = 0; + max = -1; + break; + case DP_S_DONE: + break; + default: + /* hmm? */ + break; /* some picky compilers need this */ + } + } + if (maxlen != 0) { + if (currlen < maxlen - 1) + buffer[currlen] = '\0'; + else if (maxlen > 0) + buffer[maxlen - 1] = '\0'; + } + + return currlen; +} + +static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max) +{ + int padlen, strln; /* amount to pad */ + int cnt = 0; + +#ifdef DEBUG_SNPRINTF + printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value); +#endif + if (value == 0) { + value = ""; + } + + for (strln = 0; value[strln]; ++strln); /* strlen */ + padlen = min - strln; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justify */ + + while ((padlen > 0) && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + ++cnt; + } + while (*value && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, *value++); + ++cnt; + } + while ((padlen < 0) && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + ++cnt; + } +} + +/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ + +static void fmtint(char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags) +{ + int signvalue = 0; + unsigned long uvalue; + char convert[20]; + int place = 0; + int spadlen = 0; /* amount to space pad */ + int zpadlen = 0; /* amount to zero pad */ + int caps = 0; + + if (max < 0) + max = 0; + + uvalue = value; + + if(!(flags & DP_F_UNSIGNED)) { + if( value < 0 ) { + signvalue = '-'; + uvalue = -value; + } else { + if (flags & DP_F_PLUS) /* Do a sign (+/i) */ + signvalue = '+'; + else if (flags & DP_F_SPACE) + signvalue = ' '; + } + } + + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ + + do { + convert[place++] = + (caps? "0123456789ABCDEF":"0123456789abcdef") + [uvalue % (unsigned)base ]; + uvalue = (uvalue / (unsigned)base ); + } while(uvalue && (place < 20)); + if (place == 20) place--; + convert[place] = 0; + + zpadlen = max - place; + spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); + if (zpadlen < 0) zpadlen = 0; + if (spadlen < 0) spadlen = 0; + if (flags & DP_F_ZERO) { + zpadlen = MAX(zpadlen, spadlen); + spadlen = 0; + } + if (flags & DP_F_MINUS) + spadlen = -spadlen; /* Left Justifty */ + +#ifdef DEBUG_SNPRINTF + printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", + zpadlen, spadlen, min, max, place); +#endif + + /* Spaces */ + while (spadlen > 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + --spadlen; + } + + /* Sign */ + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + /* Zeros */ + if (zpadlen > 0) { + while (zpadlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + } + + /* Digits */ + while (place > 0) + dopr_outch (buffer, currlen, maxlen, convert[--place]); + + /* Left Justified spaces */ + while (spadlen < 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++spadlen; + } +} + +static LDOUBLE abs_val(LDOUBLE value) +{ + LDOUBLE result = value; + + if (value < 0) + result = -value; + + return result; +} + +static LDOUBLE POW10(int exp) +{ + LDOUBLE result = 1; + + while (exp) { + result *= 10; + exp--; + } + + return result; +} + +static LLONG ROUND(LDOUBLE value) +{ + LLONG intpart; + + intpart = (LLONG)value; + value = value - intpart; + if (value >= 0.5) intpart++; + + return intpart; +} + +/* a replacement for modf that doesn't need the math library. Should + be portable, but slow */ +static double my_modf(double x0, double *iptr) +{ + int i; + long l; + double x = x0; + double f = 1.0; + + for (i=0;i<100;i++) { + l = (long)x; + if (l <= (x+1) && l >= (x-1)) { + if (i != 0) { + double i2; + double ret; + + ret = my_modf(x0-l*f, &i2); + (*iptr) = l*f + i2; + return ret; + } + + (*iptr) = l; + return x - (*iptr); + } + x *= 0.1; + f *= 10.0; + } + + /* yikes! the number is beyond what we can handle. What do we do? */ + (*iptr) = 0; + return 0; +} + + +static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags) +{ + int signvalue = 0; + double ufvalue; + char iconvert[311]; + char fconvert[311]; + int iplace = 0; + int fplace = 0; + int padlen = 0; /* amount to pad */ + int zpadlen = 0; + int caps = 0; + int idx; + double intpart; + double fracpart; + double temp; + + /* + * AIX manpage says the default is 0, but Solaris says the default + * is 6, and sprintf on AIX defaults to 6 + */ + if (max < 0) + max = 6; + + ufvalue = abs_val (fvalue); + + if (fvalue < 0) { + signvalue = '-'; + } else { + if (flags & DP_F_PLUS) { /* Do a sign (+/i) */ + signvalue = '+'; + } else { + if (flags & DP_F_SPACE) + signvalue = ' '; + } + } + +#if 0 + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ +#endif + +#if 0 + if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */ +#endif + + /* + * Sorry, we only support 16 digits past the decimal because of our + * conversion method + */ + if (max > 16) + max = 16; + + /* We "cheat" by converting the fractional part to integer by + * multiplying by a factor of 10 + */ + + temp = ufvalue; + my_modf(temp, &intpart); + + fracpart = ROUND((POW10(max)) * (ufvalue - intpart)); + + if (fracpart >= POW10(max)) { + intpart++; + fracpart -= POW10(max); + } + + + /* Convert integer part */ + do { + temp = intpart*0.1; + my_modf(temp, &intpart); + idx = (int) ((temp -intpart +0.05)* 10.0); + /* idx = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */ + /* printf ("%llf, %f, %x\n", temp, intpart, idx); */ + iconvert[iplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[idx]; + } while (intpart && (iplace < 311)); + if (iplace == 311) iplace--; + iconvert[iplace] = 0; + + /* Convert fractional part */ + if (fracpart) + { + do { + temp = fracpart*0.1; + my_modf(temp, &fracpart); + idx = (int) ((temp -fracpart +0.05)* 10.0); + /* idx = (int) ((((temp/10) -fracpart) +0.05) *10); */ + /* printf ("%lf, %lf, %ld\n", temp, fracpart, idx ); */ + fconvert[fplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[idx]; + } while(fracpart && (fplace < 311)); + if (fplace == 311) fplace--; + } + fconvert[fplace] = 0; + + /* -1 for decimal point, another -1 if we are printing a sign */ + padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); + zpadlen = max - fplace; + if (zpadlen < 0) zpadlen = 0; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justifty */ + + if ((flags & DP_F_ZERO) && (padlen > 0)) { + if (signvalue) { + dopr_outch (buffer, currlen, maxlen, signvalue); + --padlen; + signvalue = 0; + } + while (padlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --padlen; + } + } + while (padlen > 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + } + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + while (iplace > 0) + dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); + +#ifdef DEBUG_SNPRINTF + printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); +#endif + + /* + * Decimal point. This should probably use locale to find the correct + * char to print out. + */ + if (max > 0) { + dopr_outch (buffer, currlen, maxlen, '.'); + + while (zpadlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + + while (fplace > 0) + dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); + } + + while (padlen < 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + } +} + +static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) +{ + if (*currlen < maxlen) { + buffer[(*currlen)] = c; + } + (*currlen)++; +} + + int rsync_vsnprintf (char *str, size_t count, const char *fmt, va_list args) +{ + return dopr(str, count, fmt, args); +} +#define vsnprintf rsync_vsnprintf +#endif + +/* yes this really must be a ||. Don't muck with this (tridge) + * + * The logic for these two is that we need our own definition if the + * OS *either* has no definition of *sprintf, or if it does have one + * that doesn't work properly according to the autoconf test. + */ +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) +int rsync_snprintf(char *str,size_t count,const char *fmt,...) +{ + size_t ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(str, count, fmt, ap); + va_end(ap); + return ret; +} +#define snprintf rsync_snprintf +#endif + +#endif + +#ifndef HAVE_VASPRINTF + int vasprintf(char **ptr, const char *format, va_list ap) +{ + int ret; + va_list ap2; + + VA_COPY(ap2, ap); + + ret = vsnprintf(NULL, 0, format, ap2); + if (ret <= 0) return ret; + + (*ptr) = (char *)malloc(ret+1); + if (!*ptr) return -1; + + VA_COPY(ap2, ap); + + ret = vsnprintf(*ptr, ret+1, format, ap2); + + return ret; +} +#endif + + +#ifndef HAVE_ASPRINTF + int asprintf(char **ptr, const char *format, ...) +{ + va_list ap; + int ret; + + *ptr = NULL; + va_start(ap, format); + ret = vasprintf(ptr, format, ap); + va_end(ap); + + return ret; +} +#endif + +#ifdef TEST_SNPRINTF + + int sprintf(char *str,const char *fmt,...); + + int main (void) +{ + char buf1[1024]; + char buf2[1024]; + char *fp_fmt[] = { + "%1.1f", + "%-1.5f", + "%1.5f", + "%123.9f", + "%10.5f", + "% 10.5f", + "%+22.9f", + "%+4.9f", + "%01.3f", + "%4f", + "%3.1f", + "%3.2f", + "%.0f", + "%f", + "-16.16f", + NULL + }; + double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 203.9, 0.96, 0.996, + 0.9996, 1.996, 4.136, 5.030201, 0.00205, + /* END LIST */ 0}; + char *int_fmt[] = { + "%-1.5d", + "%1.5d", + "%123.9d", + "%5.5d", + "%10.5d", + "% 10.5d", + "%+22.33d", + "%01.3d", + "%4d", + "%d", + NULL + }; + long int_nums[] = { -1, 134, 91340, 341, 0203, 0}; + char *str_fmt[] = { + "10.5s", + "5.10s", + "10.1s", + "0.10s", + "10.0s", + "1.10s", + "%s", + "%.1s", + "%.10s", + "%10s", + NULL + }; + char *str_vals[] = {"hello", "a", "", "a longer string", NULL}; + int x, y; + int fail = 0; + int num = 0; + + printf ("Testing snprintf format codes against system sprintf...\n"); + + for (x = 0; fp_fmt[x] ; x++) { + for (y = 0; fp_nums[y] != 0 ; y++) { + int l1 = snprintf(NULL, 0, fp_fmt[x], fp_nums[y]); + int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]); + sprintf (buf2, fp_fmt[x], fp_nums[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + fp_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]); + fail++; + } + num++; + } + } + + for (x = 0; int_fmt[x] ; x++) { + for (y = 0; int_nums[y] != 0 ; y++) { + int l1 = snprintf(NULL, 0, int_fmt[x], int_nums[y]); + int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]); + sprintf (buf2, int_fmt[x], int_nums[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + int_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]); + fail++; + } + num++; + } + } + + for (x = 0; str_fmt[x] ; x++) { + for (y = 0; str_vals[y] != 0 ; y++) { + int l1 = snprintf(NULL, 0, str_fmt[x], str_vals[y]); + int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]); + sprintf (buf2, str_fmt[x], str_vals[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + str_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]); + fail++; + } + num++; + } + } + + printf ("%d tests failed out of %d.\n", fail, num); + + printf("seeing how many digits we support\n"); + { + double v0 = 0.12345678901234567890123456789012345678901; + for (x=0; x<100; x++) { + double p = pow(10, x); + double r = v0*p; + snprintf(buf1, sizeof(buf1), "%1.1f", r); + sprintf(buf2, "%1.1f", r); + if (strcmp(buf1, buf2)) { + printf("we seem to support %d digits\n", x-1); + break; + } + } + } + + return 0; +} +#endif /* TEST_SNPRINTF */ diff --git a/src/symboltable.c b/src/symboltable.c new file mode 100644 index 0000000..966ee96 --- /dev/null +++ b/src/symboltable.c @@ -0,0 +1,51 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2005,2006 Rami Lehti,Pablo Virolainen, + * Richard van den Berg + * $Header$ + * + * 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 "aide.h" +#include +#include +#include "symboltable.h" +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + +list* list_find(char* s,list* item){ + + list* l; + list* p; + + if (item==NULL) { + return NULL; + } + + p=item; + while(p!=NULL){ + if (strcmp(s,((symba*)p->data)->name)==0) return p; + p=p->next; + } + + l=item->prev; + while(l!=NULL){ + /* Insert bug to here return l-> return p */ + if (strcmp(s,((symba*)l->data)->name)==0) return l; + l=l->prev; + } + return NULL; +} diff --git a/src/util.c b/src/util.c new file mode 100644 index 0000000..ea43827 --- /dev/null +++ b/src/util.c @@ -0,0 +1,546 @@ +/* aide, Advanced Intrusion Detection Environment + * + * Copyright (C) 1999-2002,2004-2006,2010,2011,2013,2016 Rami Lehti, Pablo + * Virolainen, Mike Markley, Richard van den Berg, Hannes von Haugwitz + * $Header$ + * + * 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 "aide.h" +#include +#include +#include +#include +#include +#include +#include +/*for locale support*/ +#include "locale-aide.h" +/*for locale support*/ + + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 256 +#endif + +#include "report.h" +#include "db_config.h" +#include "util.h" + +#define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033'" +#define ISPRINT(c) (isascii(c) && isprint(c)) + +static const char* url_name[] = { + "file", "stdin", "stdout", "stderr", "fd", "sql", "syslog", "database", "https", "http", "ftp" }; + +static const int url_value[] = { + url_file, url_stdin, url_stdout,url_stderr,url_fd, url_sql, url_syslog, url_database, url_https, url_http, url_ftp }; + +const int url_ntypes=sizeof(url_value)/sizeof(URL_TYPE); + +int cmpurl(url_t* u1,url_t* u2) +{ + if(u1->type!= u2->type){ + return RETFAIL; + }; + if(strcmp(u1->value,u2->value)!=0){ + return RETFAIL; + } + + return RETOK; +}; + +url_t* parse_url(char* val) +{ + url_t* u=NULL; + char* r=NULL; + char* val_copy=NULL; + int i=0; + + if(val==NULL){ + return NULL; + } + + u=(url_t*)malloc(sizeof(url_t)); + + /* We don't want to modify the original hence strdup(val) */ + val_copy=strdup(val); + for(r=val_copy;r[0]!=':'&&r[0]!='\0';r++); + + if(r[0]!='\0'){ + r[0]='\0'; + r++; + } + u->type=url_unknown; + for(i=0;itype=url_value[i]; + break; + } + } + + switch (u->type) { + case url_file : { + if(r[0]=='/'&&(r+1)[0]=='/'&&(r+2)[0]=='/'){ + u->value=strdup(r+2); + break; + } + if(r[0]=='/'&&(r+1)[0]=='/'&&(r+2)[0]!='/'){ + char*hostname=(char*)malloc(sizeof(char)*MAXHOSTNAMELEN); + char* t=r+2; + r+=2; + for(i=0;r[0]!='/'&&r[0]!='\0';r++,i++); + if(r[0]=='\0'){ + error(0,"Invalid file-URL,no path after hostname: file:%s\n",t); + return NULL; + } + u->value=strdup(r); + r[0]='\0'; + if(gethostname(hostname,MAXHOSTNAMELEN)==-1){ + strncpy(hostname,"localhost", 10); + } + if( (strcmp(t,"localhost")==0)||(strcmp(t,hostname)==0)){ + free(hostname); + break; + } else { + error(0,"Invalid file-URL, cannot use hostname other than localhost or %s: file:%s\n",hostname,u->value); + free(hostname); + return NULL; + } + free(hostname); + break; + } + u->value=strdup(r); + + break; + } + case url_https : + case url_http : + case url_ftp : { + u->value=strdup(val); + break; + } + case url_unknown : { + error(0,"Unknown URL-type:%s\n",val_copy); + break; + } + default : { + u->value=strdup(r); + break; + } + } + + free(val_copy); + + return u; +} + +/* Returns 1 if the string contains unsafe characters, 0 otherwise. */ +int contains_unsafe (const char *s) +{ + for (; *s; s++) + if (strchr (URL_UNSAFE,(int) *s)||!ISPRINT((int)*s)) + return 1; + return 0; +} + +/* Decodes the forms %xy in a URL to the character the hexadecimal + code of which is xy. xy are hexadecimal digits from + [0123456789ABCDEF] (case-insensitive). If x or y are not + hex-digits or `%' precedes `\0', the sequence is inserted + literally. */ + +void decode_string (char* s) +{ + char *p = s; + + for (; *s; s++, p++) + { + if (*s != '%') + *p = *s; + else + { + /* Do nothing if at the end of the string, or if the chars + are not hex-digits. */ + if (!*(s + 1) || !*(s + 2) + || !(ISXDIGIT (*(s + 1)) && ISXDIGIT (*(s + 2)))) + { + *p = *s; + continue; + } + *p = (ASC2HEXD (*(s + 1)) << 4) + ASC2HEXD (*(s + 2)); + s += 2; + } + } + *p = '\0'; +} + +/* Encodes the unsafe characters (listed in URL_UNSAFE) in a given + string, returning a malloc-ed %XX encoded string. */ +char* encode_string (const char* s) +{ + const char *b; + char *p, *res; + int i; + + b = s; + for (i = 0; *s; s++, i++){ + if (strchr (URL_UNSAFE,(int) *s)||!ISPRINT((int)*s)){ + i += 2; /* Two more characters (hex digits) */ + } + } + + res = (char *)malloc (i + 1); + s = b; + for (p = res; *s; s++){ + if (strchr (URL_UNSAFE, *s)||!ISPRINT((int)*s)) + { + const unsigned char c = *s; + *p++ = '%'; + *p++ = HEXD2ASC (c >> 4); + *p++ = HEXD2ASC (c & 0xf); + } + else { + *p++ = *s; + } + } + *p = '\0'; + return res; +} + +char* perm_to_char(mode_t perm) +{ + char*pc=NULL; + int i=0; + + pc=(char*)malloc(sizeof(char)*11); + for(i=0;i<10;i++){ + pc[i]='-'; + } + pc[10]='\0'; + + if(S_ISDIR(perm)) + pc[0]='d'; +#ifdef S_ISFIFO + if(S_ISFIFO(perm)) + pc[0]='p'; +#endif + if(S_ISLNK(perm)) + pc[0]='l'; + if(S_ISBLK(perm)) + pc[0]='b'; + if(S_ISCHR(perm)) + pc[0]='c'; +#ifdef S_ISDOOR + if(S_ISDOOR(perm)) + pc[0]='|'; +#endif +#ifdef S_ISSOCK + if(S_ISSOCK(perm)) + pc[0]='s'; +#endif + + if((S_IRUSR&perm)==S_IRUSR){ + pc[1]='r'; + } + if((S_IWUSR&perm)==S_IWUSR){ + pc[2]='w'; + } + if((S_IXUSR&perm)==S_IXUSR){ + pc[3]='x'; + } + if((S_IRGRP&perm)==S_IRGRP){ + pc[4]='r'; + } + if((S_IWGRP&perm)==S_IWGRP){ + pc[5]='w'; + } + if((S_IXGRP&perm)==S_IXGRP){ + pc[6]='x'; + } + if((S_IROTH&perm)==S_IROTH){ + pc[7]='r'; + } + if((S_IWOTH&perm)==S_IWOTH){ + pc[8]='w'; + } + if((S_IXOTH&perm)==S_IXOTH){ + pc[9]='x'; + } + + if((S_ISUID&perm)==S_ISUID){ + if((S_IXUSR&perm)==S_IXUSR){ + pc[3]='s'; + } else { + pc[3]='S'; + } + } + if((S_ISGID&perm)==S_ISGID){ + if((S_IXGRP&perm)==S_IXGRP){ + pc[6]='s'; + } else { + pc[6]='l'; + } + } +#if defined (S_ISVTX) && defined (S_IXOTH) + if((S_ISVTX&perm)==S_ISVTX){ + if((S_IXOTH&perm)==S_IXOTH){ + pc[9]='t'; + } else { + pc[9]='T'; + } + } +#endif + + error(240,"perm_to_char(): %i -> %s\n",perm,pc); + + return pc; +} + +void init_sighandler() +{ + signal(SIGBUS,sig_handler); + signal(SIGTERM,sig_handler); + signal(SIGUSR1,sig_handler); + signal(SIGUSR2,sig_handler); + signal(SIGHUP,sig_handler); + + return; +} + +void sig_handler(int signum) +{ + switch(signum){ + case SIGBUS : + case SIGSEGV :{ + error(200,"Caught SIGBUS/SIGSEGV\n"); + if(conf->catch_mmap==1){ + error(4,"Caught SIGBUS/SEGV while mmapping. File was truncated while aide was running?\n"); + conf->catch_mmap=0; + } else { + error(0,"Caught SIGBUS/SEGV. Exiting\n"); + exit(EXIT_FAILURE); + } + break; + } + case SIGHUP : { + error(4,"Caught SIGHUP\n"); + break; + } + case SIGTERM : { + error(4,"Caught SIGTERM\nUse SIGKILL to terminate\n"); + break; + } + case SIGUSR1 : { + error(4,"Setting output to debug level according to signal\n"); + conf->verbose_level=220; + break; + } + case SIGUSR2 : { + error(4,"Setting output to normal level according to signal\n"); + conf->verbose_level=5; + break; + } + } + error(220,"Caught signal %d\n",signum); + init_sighandler(); + + return; +} + +char *expand_tilde(char *path) { + char *homedir, *full; + size_t path_len, homedir_len, full_len; + + if (path != NULL) { + if (path[0] == '~') { + if((homedir=getenv("HOME")) != NULL) { + path_len = strlen(path+sizeof(char)); + homedir_len = strlen(homedir); + full_len = homedir_len+path_len; + full = malloc(sizeof(char) * (full_len+1)); + strncpy(full, homedir, homedir_len); + strncpy(full+homedir_len, path+sizeof(char), path_len); + full[full_len] = '\0'; + free(path); + /* Don't free(homedir); because it is not safe on some platforms */ + path = full; + } else { + error(3, _("Variable name 'HOME' not found in environment. '~' cannot be expanded\n")); + } + } else if (path[0] == '\\' && path[1] == '~') { + path += sizeof(char); + } + } + return path; +} + +/* Like strstr but only do search for maximum of n chars. + haystack does not have to be NULL terminated + needle has to be NULL terminated. NULL in needle is not used in compare. + NULLs in haystack are ignored. +*/ +#ifndef HAVE_STRNSTR +char* strnstr(char* haystack,char* needle,int n) +{ + char* h=haystack; + char* s=needle; + int slen=strlen(s); + int i=0; + + for(i=0;imaxlen) + return maxlen; + return l; +} +#endif + +/* Lookup syslog facilities by name */ +int syslog_facility_lookup(char *s) +{ + if(!s || strlen(s)<1) + return(AIDE_SYSLOG_FACILITY); +#ifdef LOG_KERN + if(strcasecmp(s,"LOG_KERN")==0) + return(LOG_KERN); +#endif +#ifdef LOG_USER + if(strcasecmp(s,"LOG_USER")==0) + return(LOG_USER); +#endif +#ifdef LOG_MAIL + if(strcasecmp(s,"LOG_MAIL")==0) + return(LOG_MAIL); +#endif +#ifdef LOG_DAEMON + if(strcasecmp(s,"LOG_DAEMON")==0) + return(LOG_DAEMON); +#endif +#ifdef LOG_AUTH + if(strcasecmp(s,"LOG_AUTH")==0) + return(LOG_AUTH); +#endif +#ifdef LOG_SYSLOG + if(strcasecmp(s,"LOG_SYSLOG")==0) + return(LOG_SYSLOG); +#endif +#ifdef LOG_LPR + if(strcasecmp(s,"LOG_LPR")==0) + return(LOG_LPR); +#endif +#ifdef LOG_NEWS + if(strcasecmp(s,"LOG_NEWS")==0) + return(LOG_NEWS); +#endif +#ifdef LOG_UUCP + if(strcasecmp(s,"LOG_UUCP")==0) + return(LOG_UUCP); +#endif +#ifdef LOG_CRON + if(strcasecmp(s,"LOG_CRON")==0) + return(LOG_CRON); +#endif +#ifdef LOG_LOCAL0 + if(strcasecmp(s,"LOG_LOCAL0")==0) + return(LOG_LOCAL0); +#endif +#ifdef LOG_LOCAL1 + if(strcasecmp(s,"LOG_LOCAL1")==0) + return(LOG_LOCAL1); +#endif +#ifdef LOG_LOCAL2 + if(strcasecmp(s,"LOG_LOCAL2")==0) + return(LOG_LOCAL2); +#endif +#ifdef LOG_LOCAL3 + if(strcasecmp(s,"LOG_LOCAL3")==0) + return(LOG_LOCAL3); +#endif +#ifdef LOG_LOCAL4 + if(strcasecmp(s,"LOG_LOCAL4")==0) + return(LOG_LOCAL4); +#endif +#ifdef LOG_LOCAL5 + if(strcasecmp(s,"LOG_LOCAL5")==0) + return(LOG_LOCAL5); +#endif +#ifdef LOG_LOCAL6 + if(strcasecmp(s,"LOG_LOCAL6")==0) + return(LOG_LOCAL6); +#endif +#ifdef LOG_LOCAL7 + if(strcasecmp(s,"LOG_LOCAL7")==0) + return(LOG_LOCAL7); +#endif + + error(0,"Syslog facility \"%s\" is unknown, using default\n",s); + return(AIDE_SYSLOG_FACILITY); +} + +/* We need these dummy stubs to fool the linker into believing that + we do not need them at link time */ + +void* dlopen(char*filename,int flag) +{ + return NULL; +} + +void* dlsym(void*handle,char*symbol) +{ + return NULL; +} + +void* dlclose(void*handle) +{ + return NULL; +} + +const char* dlerror(void) +{ + return NULL; +} + +const char* aide_key_2=CONFHMACKEY_02; +const char* db_key_2=DBHMACKEY_02; diff --git a/version.m4 b/version.m4 new file mode 100644 index 0000000..5c26008 --- /dev/null +++ b/version.m4 @@ -0,0 +1 @@ +m4_define([AIDE_VERSION], [0.16]) diff --git a/ylwrap b/ylwrap new file mode 100755 index 0000000..7c2d927 --- /dev/null +++ b/ylwrap @@ -0,0 +1,247 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2013-01-12.17; # UTC + +# Copyright (C) 1996-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 +# . + +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: "UTC" +# time-stamp-end: "; # UTC" +# End: